Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# SeleniumLibrary localisation project
This project contains all localizations for the Robot Framework SeleniumLibrary. Currently project contains only one translation,
[Finnish](https://github.com/MarketSquare/robotframework-seleniumlibrary-translation/blob/main/robotframework_seleniumlibrary_translation/translation_fi.json)
This project contains all localizations for the Robot Framework SeleniumLibrary. Currently project contains two translations:
- [Finnish](https://github.com/MarketSquare/robotframework-seleniumlibrary-translation/blob/main/robotframework_seleniumlibrary_translation/translation_fi.json)
- [French] (https://github.com/MarketSquare/robotframework-seleniumlibrary-translation/blob/main/robotframework_seleniumlibrary_translation/translation_fr.json)
, but new languages can be added by creating translation_xx.json file and adding the definition to
[init.py](https://github.com/MarketSquare/robotframework-seleniumlibrary-translation/blob/main/robotframework_seleniumlibrary_translation/__init__.py)
file. The xx should be replaced with correct language code.
Expand All @@ -9,7 +10,8 @@ This project uses SeleniumLibrary Python plugin API to provide translation_xx.js
Seleniumlibrary. SeleniumLibrary searches Python plugins by using naming convention: `robotframework_seleniumlibrary_translation`. This module fulfils the SeleniumLibrary
translation API and provides `get_language` method. The method return a list of dictionaries:

[{"language": "fi", "path": "/path/to/translation_fi.json"}]
[{"language": "fi", "path": "/path/to/translation_fi.json"},
{"language": "fr", "path": "/path/to/translation_fr.json"}]

Which SeleniumLibrary will use to match correct translation from all the found Python plugins.
Language search is enabled when SeleniumLibrary is imported with:
Expand All @@ -18,10 +20,16 @@ Language search is enabled when SeleniumLibrary is imported with:
*** Settings ***
Library SeleniumLibrary language=fi
```
or:

```robotframework
*** Settings ***
Library SeleniumLibrary language=fr
```

# Detect changes in documentation
The translation_xx.json contains sha256 sum, which is generated by the SeleniumLibrary. The sha256
is the checksum of the original documentation of the SeleniumLibrary documentation. The checksum
is used by `sellib translation --compare robotframework_seleniumlibrary_translation/translation.json`
is used by `selib translation --compare robotframework_seleniumlibrary_translation/translation.json`
command to compare translation between the library and translation file. Command will display a list
of keywords which needs updating or are missing from the translation.json file.
3 changes: 2 additions & 1 deletion robotframework_seleniumlibrary_translation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ class Language(TypedDict):
def get_language() -> list[Language]:
folder = Path(__file__).parent

return [{"language": "fi", "path": str(folder / "translation_fi.json")}]
return [{"language": "fi", "path": str(folder / "translation_fi.json")},
{"language": "fr", "path": str(folder / "translation_fr.json")}]
Loading