B
by bernd on 17 Dec 2020, edited 17 Dec 2020
#
Do yo mean the missing gettext?
The problem with gettext is ho to set the language in the code. I do not want the system language, The feature file defines the language, thus the assert method should be called with the language and inside this somehow the language needs to be passed for the otpt strings.
The same cold be set in the report. We cold get rid of the json translation files than.
In short I need a runtime language switch
B
by bernd on 17 Dec 2020, edited 17 Dec 2020
#
It should work but it does not :-(
https://github.com/berndhahnebach/gettexttest
running the program it should print the German translation no matter which language is set on the system.
but it prints:
$
$ python3 ./main.py
/home/hugo/Documents/dev/gettext/locale
Traceback (most recent call last):
File "./main.py", line 9, in <module>
new_lang = gettext.translation('base', localedir=localepath, languages=['de'])
File "/usr/lib/python3.7/gettext.py", line 539, in translation
'No translation file found for domain', domain)
FileNotFoundError: [Errno 2] No translation file found for domain: 'base'
$
B
by bernd on 17 Dec 2020
#
I could get rid of the error, but it does not print the translation. :-(
I updated the repo.
B
by bernd on 17 Dec 2020
#
import gettext
new_lang = gettext.translation('messages', localedir=localepath, languages=['de'])
new_lang.install()
Works great but what is needed to get no translation, means the pure string not translated?
A possibility would be to use language en and just copy the string in the po file, but this seams not smart IMHO.
B
by bernd on 17 Dec 2020
#
how about this ... https://gitlab.com/bimtester/bimtesterfc/-/commits/main
M
by Moult on 17 Dec 2020
#
@bernd I don't see an issue with showing an error for untranslated strings - it's a prompt for translators to resolve it :)
B
by bernd on 18 Dec 2020
#
Just realized, I commited mo files. But the should not be in the git of ifcopenshell or should they?
M
by Moult on 18 Dec 2020
#
@bernd I haven't worked with gettext personally so I don't know how the system works (I assume mo is generated from po?). I trust you to make the right decision. Feel free to just go for it - I'll merge any PR you make as soon as I can :) I haven't looked much at the bimtester code for a while, so when I get the time to hack on it again maybe I'll have more opinions.
I'll create an issue asking Thomas to give you commit access so you don't need to keep on submitting PRs. In general so long as you stick to the Python code and ask before editing other codebases before you are familiar, just go for it :) In the case of BIMTester, I think you are more than familiar and I'm happy for you to hack on it any way you see fit! Especially as you are also testing it in real life which is the most important!
B
by bernd on 18 Dec 2020
#
+2 votes
OK, great.
In the regard of write access. As maintainer of FreeCAD FEM I have write access to FreeCAD main repo. But I only write to FEM, Arch and Draft. For all other changes I go for a PR. Means I am used to such work flow.
B
by bernd on 8 Jan 2021, edited 8 Jan 2021
#
+2 votes
Most of translation framework has settled down. If someone is interested in translating some of bimtester strings, templates and step tests, go ahead ... https://github.com/IfcOpenShell/IfcOpenShell/tree/v0.6.0/src/ifcbimtester
How to get started
T
by tlang on 8 Jan 2021
#
Very nice @bernd . I'd like to offer my help with translation to Italian and Dutch @Meetlat. Do I need any special write permissions, do I need to create a fork or can I just start by copying in same location and renaming an existing file in another language, like e.g "geometric_detail_de.py" to "geometric_detail_it.py"?
B
by bernd on 10 Jan 2021
#
That would be great.
@tlang said:
Very nice @bernd . I'd like to offer my help with translation to Italian and Dutch @Meetlat. Do I need any special write permissions, do I need to create a fork or can I just start by copying in same location and renaming an existing file in another language, like e.g "geometric_detail_de.py" to "geometric_detail_it.py"?
depends if you would like to use BIMTester yourself or just like to help with translation. If you would like to run it yourself you should get to work it before start with translation. It needs some dependencies. If you just would like to help with translation, I would set up everything to be ready to just translate into Italian and Dutch. You would not need to run bimtester yourself.
B
by bernd on 11 Jan 2021
#
+2 votes
find two branches:
Best to start with the feature file an the one string in the python file. Afterwards translating the po file makes sense. Work as you like either make it on github or post the translated file here.
cheers bernd
M
by Meetlat on 15 Jan 2021, edited 15 Jan 2021
#
+1 votes
See attachment. When the translation is integrated I will check the texts. Now I miss the context of the sentences.
Also I noticed that some mistakes? For example see line 63 of messages.po (msgid "" "For all {elemcount} {ifc_class} elements at least one of these class "
"attributes {parameter} has no value.") I thing this should be (msgid "For all {elemcount} {ifc_class} elements at least one of these class "
"attributes {parameter} has no value.") So no empty (msgid "") right? I corrected those
T
by tlang on 16 Jan 2021
#
+1 votes
@bernd I'm attaching the three files I understood needed to be translated. As @Meetlat I'd like to use the programme to understand if the translation is good in it's context. As to correctness of the source, I don't understand about the double occurrences of {elemcount} {elemcount} in messages.po.
M
by Meetlat on 18 Jan 2021
#
@given("Het IFC-bestand is aangeleverd via een argument")
or perhaps this is better:
@given("Het IFC-bestand is aangeleverd via een parameter")
The term parameter is more common than argument
T
by tlang on 3 Feb 2021
#
@bernd I installed the latest blenderbim addin. When selecting bimtester it asks me for the feature file directory. Now how do I load all the feature files from the github repository?
M
by Moult on 3 Feb 2021
#
@tlang - I've significantly changed the BIMTester behaviour now to request a single feature file by default. The ability to do a bulk feature check will turn into an advanced user option. Maybe it's best to wait until the next version. Perhaps @condur and I can do a video explaining it too.
T
by tlang on 4 Feb 2021
#
@Moult my question meant to be more on how to actually download the feature files to my hard drive. I would like to run some single feature files, also to check my translation to Italian. Having said that I would much appreciate a video explainer.
Regarding use cases I found back an article that implements Dutch and Norwegian national BIM requirements. Maybe Bimtester could do the same?