org.hl7.fhir.core icon indicating copy to clipboard operation
org.hl7.fhir.core copied to clipboard

Option locale without effect

Open mmreith opened this issue 4 years ago • 9 comments

The option locale has no function

-locale en

does not change the output

mmreith avatar Dec 23 '20 08:12 mmreith

what language did you try?

grahamegrieve avatar Feb 07 '21 22:02 grahamegrieve

just english (en). Language is set to german by default through windows command, but i need the display in english for debugging purposes.

mmreith avatar Feb 08 '21 06:02 mmreith

I'm assuming this is regarding the output of the validator cli @mmreith ?

markiantorno avatar Aug 11 '21 20:08 markiantorno

@markiantorno correct. Do you need more information?

mmreith avatar Aug 12 '21 07:08 mmreith

@mmreith can you send me the exact steps to reproduce please?

Thank you.

markiantorno avatar Aug 16 '21 17:08 markiantorno

@markiantorno My call was (but you could use whatever you like): java -jar validator_cli.jar -ig aws-zertifizierung\Sollprofile\PF20_all_Mussfelder -ig aws-zertifizierung\Sollprofile\PF24 -ig aws-zertifizierung\Sollprofile\PF22_24_Mussfelder -ig KBV_FHIR_AW\KBV-Basis -ig KBV_FHIR_AW\Terminologie -ig KBV_FHIR_AW\Application -ig KBV_FHIR_AW\Extensions-KOPIE -ig de.basisprofil.r4#0.9.11 -version 4.0.1 -recurse -no-extensible-binding-warnings -locale en Mustermann_Martina_5faa0942-a96c-43c7-ad25-0854829bd083_AW.xml

but i did not get an output in english. If you want to reproduce that, you might have to set -locale de, since this is an available translation,

mmreith avatar Aug 18 '21 04:08 mmreith

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Feb 09 '22 10:02 stale[bot]

@markiantorno do you need more information?

mmreith avatar Feb 10 '22 07:02 mmreith

I'm having the same problem and now I find that it has already been reported here.

F7 confirms that the parameter gets parsed correctly and that CliContext.locale (which defaults to English anyway) gets set accordingly. Couldn't find where the translation occurs because it doesn't happen when I run the jar under the IntelliJ debugger (had -locale nl in order to make it differ from both the system locale and defaultish locales like C or en).

One problem definitely lies in CliContext.setLocale(Locale), which receives a valid Locale object but stores only its localised display language name. In CliContext.getLocale() there is a half-hearted attempt at getting a Locale object for this stored string, but that must fail because a localised display language name is not a valid BCP 47 language tag as expected by Locale.forLanguageTag(String).

Replacing locale.getDisplayLanguage() with locale.toLanguageTag() in CliContext.setLocale(Locale) should fix that particular problem. However, whether this solves the problem with the -locale parameter remains to be seen. I am in no position to build the validator jar, so I cannot test this.

@markiantorno: found one link in the causal chain for the '-locale' problem; could you please have a look?

DarthGizka avatar May 27 '22 15:05 DarthGizka

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Nov 18 '22 20:11 stale[bot]

That feature would still be nice

mmreith avatar Nov 22 '22 12:11 mmreith

Fixed in https://github.com/hapifhir/org.hl7.fhir.core/pull/1002

dotasek avatar Nov 24 '22 14:11 dotasek