-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Multilanguage support for markers used in data #4096
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Leaving myself here so I will remember to add option for robotidy to autotranslate tokens. And it would be interesting to add support for polish. Although I don't have idea how to translate some of the keywords such as [Teardown] (probably not |
Yeah, coming up with good translations for some of these terms is going to be hard. No idea what Teardown could be in Finnish either. A major problem related to this is that changing terms would be backwards incompatible. Perhaps we should support English always so that hard-to-translate terms could be initially skipped. |
Great Idea. |
We decided to move this one and highly related non-English Given/When/Then support (#519) to RF 5.1. That wasn't done because we don't consider these issues important, on the contrary, but simply because RF 5.0 already contains lot of great new features and we want to get it out as soon as possible. These translation related issues will be the highest priority issues in RF 5.1 and the plan is to start its development right after RF 5.0 has been released. |
We need to do some technical choices before proceeding with the implementation.
Since this is mostly a lookup problem (does a given string, say In addition, it needs to be decided whether we support multiple forms for some tokens. For example, currently the table headers allow both singular and plural English form ( Based on all the above, some options for the configuration file format are: Of these, INI files and JSON are the ones having parsers in the Python standard library. |
I would really like to also results be considered. How does log.html look like |
@yanne one thing I would also think are the existing standards and work beyond Python standard libs. |
Translating log and report is important but it would most likely be better to update their underlying tech first. We are planning to do such tech update with Libdoc already in RF 5.1 (#4304) and if that goes well then log/report could be next. |
This supporting English forever would solve (or work-around) the problem of deciding what to translate and what to leave in English. I rather wish RF not to enforce using translations even if they are available---then everyone can decide whether e.g. whether they will write RETURN in English or in their language. (This is Robocop what I probably wish to (optionally) check whether a translation was used wherever possible.) |
The plan is to support English as an alternative automatically. In the future we may make that configurable if there are needs. Notice also that at least in the beginning we don't plan to support translating control structures like |
📢 This comment lists everything that can be translated in RF 5.1. Markers to translate, covered by this issue, are just headers and settings. With headers we support both singular and plural formats in English and we can support them also with other languages. For test related headers and settings we have task related aliases. Other translations in RF 5.1 are Given/When/Then prefixes used in behavior-driven development (BDD) which is coveted by issue #519. With these prefixes it is probably a good idea to look at what translations Cucumber uses. Headers:
Settings in the Settings section:
Settings for tests/tasks:
Settings for keywords:
BDD prefixes (#519)
|
We obviously need help from the community with translations. We have decided to use the |
If anyone wants to join in on the translation of RF please submit your translation here https://robotframework.crowdin.com/robot-framework |
This zip file contains:
|
This was needed for testing purposes (and tests were added as well). Need to be still updated based on what's agreed on at https://robotframework.crowdin.com/robot-framework
I added initial translations for Finnish for testing and demonstration purposes in bfec5a5. Everything that was needed is the new I would prefer languages to be added via pull requests by their respective authors to have contact info for them automatically stored. It's fine to leave some of the terms untranslated, the English terms will nevertheless work. You many also decide not to translate |
Notice that the class in the languages module will be the name of the language to use from the command line. Matching name is case-insensitive so, for example, the aforementioned Language variants such as Brazilian Portuguese could have a class name like |
I would suggest we use and stick to whatever the commonly accepted syntax for describing languages is. I think is the ISO standard - ISO 639-1 and then the additional macrolanguages. I would stick to the hyphen and be strict in interpreting it. |
Better use the hyphen then. The following should be accepted: No With With With With |
I don't think we need an environment variable to control the language. We already support |
I don't want to make handling language codes too complicated at least in RF 5.1. For example, I don't want to do any extra lookups if someone uses The hyphen in |
Big thanks for @leeuwe for setting up Crowdin to have a place where the community can work together with translations. Thanks also to everyone who has already participated in translation efforts. If you want to test translations created at Crowdin, you need to download the language file (seems to be named
The generated Python code can be used directly with Robot Framework like |
The support for localized markers ought to be done now. We still need to add actual translations and document all this, but that's covered by #4390. |
Currently we can only use English with section headers, settings, and other such markers in the data. For example:
Supporting other languages would be great. For example, the above could look like this in Finnish:
Getting this done requires:
--language FI
.--language FI --language EN
to allow customizing how a certain language is used e.g. like--language FI:some:config
.--language mylang.txt
.I hope the wider community can help with translations when we get that far. Comments about the design decisions above are appreciated as well.
I consider making Robot Framework more native in non-English speaking languages pretty important and thus assign this to RF 5.0 scope with critical priority. The old issue about non-English Given/When/Then prefixes (#519) is highly related and already in RF 5.0 scope.
There are many other related enhancements like translating log and report, translating error message, translating keywords used in generic libraries, and so on. They all require their own issues and probably need to wait for future RF versions.
The text was updated successfully, but these errors were encountered: