Skip to content

Commit

Permalink
Fixing testing and config
Browse files Browse the repository at this point in the history
  • Loading branch information
aaltat committed Sep 16, 2024
1 parent fbdc4b2 commit 40fb29f
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 691 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,21 @@
[![All Contributors](https://img.shields.io/github/all-contributors/MarketSquare/robotframework-browser-translation-fi?color=ee8449&style=flat-square)](#contributors)


This project contains a Finnish transation for the Robot Framework
This project contains a transations for the Robot Framework
[Browser](https://github.com/MarketSquare/robotframework-browser)
libary.
libary. Currently project contais only one translation, Finnish, but
new languages can be added by creating translation_xx.json file
and adding the file to
[__init__.py](https://github.com/MarketSquare/robotframework-browser-translation-fi/blob/main/robotframework_browser_translation_fi/translation_fi.json) file.

This project uses Browser library
[Python plugin API](https://packaging.python.org/en/latest/guides/creating-and-discovering-plugins/)
to provide
[translation.json](https://github.com/MarketSquare/robotframework-browser-translation-fi/blob/main/robotframework_browser_translation_fi/translation.json)
[translation.json](https://github.com/MarketSquare/robotframework-browser-translation-fi/blob/main/robotframework_browser_translation_fi/translation_fi.json)
file for the Browser library. Browser library searches Python plugins by using
naming convention: `robotframework_browser_translation`. This module
fulfils the Browser library translation API and provides `get_language`
metghod. The method return a dictionry:
metghod. The method return a list of dictionries:

```Python
{"language": "fi", "path": "/opath/to/translation.json")}
Expand Down
5 changes: 1 addition & 4 deletions atest/translation.robot
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
*** Settings ***
Library Browser language=FI
Library Process
Library OperatingSystem
Library json_lib.py

*** Test Cases ***
Translation Works With Translation
Uusi Sivu https://github.com/MarketSquare/robotframework-browser-translation-fi
Uusi Sivu https://github.com/MarketSquare/

LibDoc Works With Translation
[Setup] Remove File ${CURDIR}/Browser.json
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Changelog = "https://github.com/MarketSquare/robotframework-browser-translation-
packages = ["robotframework_browser_translation"]

[tool.setuptools.package-data]
robotframework_browser_translation_fi = ["*.json"]
robotframework_browser_translation = ["*.json"]

[tool.semantic_release]
version_toml = [
Expand Down
5 changes: 2 additions & 3 deletions robotframework_browser_translation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ class Language(TypedDict):
path: str


def get_language() -> Language:
def get_language() -> list[Language]:
folder = Path(__file__).parent

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

0 comments on commit 40fb29f

Please sign in to comment.