Localization

Trying to made my own build with little bit more correct Russian localization.
Created jar works perfect on mac os, but generate lot of errors
“ERROR i18.impl :: Error translating to ru: no resource bundle” on Windows.
GUI looks correctly localized on both platforms.
Please advice
Best Regards
Max

Hi @Max.A
It would be much appreciated if you wanted to help making the translation more correct via https://poeditor.com/join/project/ynjQmwSsGh since that’s where the localizations are updated.
There’s shouldn’t be any difference if you are running a JAR, but perhaps your Java environment has a different user.language on the two OS. Check “Diagnostic Info” in Admin > Troubleshooting, when you have started Metabase on both OS.

Hi @flamber
Environments have same user.language, but different java version. Does it make any sense?
{“file.encoding” “UTF-8”, “java.runtime.name” “Java™ SE Runtime Environment”, “java.runtime.version” “14.0.1+7”, “java.vendor” “Oracle Corporation”, “java.vendor.url” “https://java.oracle.com/”, “java.version” “14.0.1”, “java.vm.name” “Java HotSpot™ 64-Bit Server VM”, “java.vm.version” “14.0.1+7”, “os.name” “Mac OS X”, “os.version” “10.15.7”, “user.language” “en”, “user.timezone” “Europe/Moscow”}

{
“file.encoding”: “UTF-8”,
“java.runtime.name”: “Java™ SE Runtime Environment”,
“java.runtime.version”: “1.8.0_261-b12”,
“java.vendor”: “Oracle Corporation”,
“java.vendor.url”: “http://java.oracle.com/”,
“java.version”: “1.8.0_261”,
“java.vm.name”: “Java HotSpot™ 64-Bit Server VM”,
“java.vm.version”: “25.261-b12”,
“os.name”: “Windows Server 2019”,
“os.version”: “10.0”,
“user.language”: “en”,
“user.timezone”: “Europe/Moscow”
},

By the way, new build scrip has no “no-translations” option any more and it fails with error
“Java compiler not found, try installing gcj or set $JAVAC\nmsgfmt: compilation of Java class failed, please try --verbose or set $JAVAC”. I have the same problem with previous build script, but I use msgfmt --source, compile resources separately and build with no-translations option.
Please advice, is it possible to make a same thing with a new script? Or to make msgfmt working? ( $JAVAC does not help )

@Max.A There shouldn’t be any difference, but you can try using the same version on both OS.
https://www.metabase.com/docs/latest/operations-guide/java-versions.html

You are seeing this issue - I don’t use Mac, so I cannot help any further with that part:
https://github.com/metabase/metabase/issues/13513

But it sounds like that’s you problem, that it’s actually not building with the translations - but then I don’t understand how it runs correctly on one of the OS, but not the other. I have a feeling that you’re running different JAR files or something like that, otherwise I don’t understand why you’re seeing a difference.

Well, files are same for sure. Both GUI are localized correctly and with all changes I’ve made …

@Max.A But there are localization in frontend and backend, so it sounds like the backend is broken for some reason.

I guess I found the reason. Structures of my Message_ru.class
image
and stock Message_ru.classimage are different.
javac requires using -Xlint option for Message_ru.java generated by msgfmt --source and prints the following warnings:
resources/metabase/Messages_ru.java:8251: warning: [unchecked] getKeys() in Messages_ru overrides getKeys() in ResourceBundle
public java.util.Enumeration getKeys () {
^
return type requires unchecked conversion from Enumeration to Enumeration
resources/metabase/Messages_ru.java:8251: warning: [rawtypes] found raw type: Enumeration
public java.util.Enumeration getKeys () {
^
missing type arguments for generic class Enumeration
where E is a type-variable:
E extends Object declared in interface Enumeration
resources/metabase/Messages_ru.java:8253: warning: [rawtypes] found raw type: Enumeration
new java.util.Enumeration() {
^
missing type arguments for generic class Enumeration
where E is a type-variable:
E extends Object declared in interface Enumeration

It was a result of using oracle jdk for mac. Adoptopen JDK generate correct jar.

1 Like