@@ -487,6 +487,46 @@ documentation for further details.
487487
488488Plugin API is new SeleniumLibrary 4.0
489489
490+ = Language =
491+
492+ SeleniumLibrary offers possibility to translte keyword names and documentation to new language. If language
493+ is defined, SeleniumLibrary will search from
494+ [https://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#module-search-path | module search path]
495+ Python packages starting with `robotframework_seleniumlibrary_translation` by using
496+ [https://packaging.python.org/en/latest/guides/creating-and-discovering-plugins/ | Python pluging API]. Library
497+ is using naming convention to find Python plugins.
498+
499+ The package must implement single API call, ``get_language`` without any arguments. Method must return a
500+ dictionary containing two keys: ``language`` and ``path``. The language key value defines which language
501+ the package contains. Also value should match (case insentive) the library ``language`` import parameter.
502+ The path parameter value should be full path to the translation file.
503+
504+ == Translation file ==
505+
506+ The file name or extension is not important, but data must be in [https://www.json.org/json-en.html | json]
507+ format. The keys of json are the methods names, not the keyword names, which implements keywords. Value of
508+ key is json object which contains two keys: ``name`` and ``doc``. The ``name`` key contains the keyword
509+ translated name and `doc` contains translated documentation. Providing doc and name are optional, example
510+ translation json file can only provide translations to keyword names or only to documentatin. But it is
511+ always recomended to provide translation to both name and doc. Special key ``__intro__`` is for class level
512+ documentation and ``__init__`` is for init level documentation. These special values ``name`` can not be
513+ translated, instead ``name`` should be kept the same.
514+
515+ == Generating template translation file ==
516+
517+ Template translation file, with English language can be created by running:
518+ `rfselib translation /path/to/translation.json` command. Command does not provide translations to other
519+ languages, it only provides easy way to create full list keywords and their documentation in correct
520+ format. It is also possible to add keywords from library plugins by providing `--plugings` arguments
521+ to command. Example: `rfselib translation --plugings myplugin.SomePlugin /path/to/translation.json` The
522+ genered json file contains `sha256` key, which constains the sha256 sum of the library documentation,
523+ the sha256 sum is used by `rfselib translation --compare /path/to/translation.json` command, which compares
524+ transation to to library and prints outs a table which tell if there are changes needed for translation file.
525+
526+ Example project for translation can be found from
527+ [https://github.com/MarketSquare/robotframework-seleniumlibrary-translation-fi | robotframework-seleniumlibrary-translation-fi]
528+ repository.
529+
490530= Plugin: my_lib =
491531
492532Some dummy documentation.
0 commit comments