Skip to content
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

i18n for REST APIs and error messages #68

Merged
merged 11 commits into from
Nov 6, 2019
Merged

i18n for REST APIs and error messages #68

merged 11 commits into from
Nov 6, 2019

Conversation

plavjanik
Copy link
Contributor

@plavjanik plavjanik commented Oct 30, 2019

This a first pull request for #39.

The documentation and instructions are in https://github.com/zowe/sample-spring-boot-api-service/pull/68/files?short_path=d9af631#diff-d9af6310659c7ac8fee1baf3ab693bd1.

The Swagger/Springfox localization is not in this PR and it will be delivered in another PR. This one is over 700 lines now which a high number already.

The Czech localization is not complete and it is not the goal - the purpose is only for testing, not to provide a complete localization.

I realized that some things in the original error messages functionality from the old SDK could be done nicer (e.g. use ResourceBundles, or same formatting using curly braces {} as the Spring instead of C-style) but I tried to preserve the existing API and messages.yml format and just add new functionality on top of it so existing users are not affected.

  • A way how to define i18n for strings in the code
  • A way how to define i18n for numbered messages (ErrorService)
  • A method of how the required locale is provided to the REST API is defined and propagated the code that is getting the strings or messages, ideally with a little coding
  • A method how the service default locale is defined/configured and used in the threads that are not connected to a REST API request
  • Greeting endpoint is localized
  • Server messages are localized
  • Czech or other localization is provided (for testing purposes)
  • Documentation
  • Check the special characters in the spool output
  • Check the special characters in the SSH session

Suggestions:

  • A tool that generates localized ResourceBundle properties with content ready for translation (.properties files) with unlocalized and commented text that can be easily translated without going back and forth to the original one and verifies that the translation is complete - added as zowe-api-dev command for i18n and messages #70

Signed-off-by: Petr Plavjanik <plavjanik@gmail.com>
Signed-off-by: Petr Plavjanik <plavjanik@gmail.com>
Signed-off-by: Petr Plavjanik <plavjanik@gmail.com>
Signed-off-by: Petr Plavjanik <plavjanik@gmail.com>
Signed-off-by: Petr Plavjanik <plavjanik@gmail.com>
Signed-off-by: Petr Plavjanik <plavjanik@gmail.com>
Signed-off-by: Petr Plavjanik <plavjanik@gmail.com>
Signed-off-by: Petr Plavjanik <plavjanik@gmail.com>
@plavjanik plavjanik changed the title wip - i18n i18n for REST APIs and error messages Oct 31, 2019
Signed-off-by: Petr Plavjanik <plavjanik@gmail.com>
@plavjanik
Copy link
Contributor Author

image

What needs to be done for Czech accented characters on the mainframe:

  • The Java application needs to start with IJO="$IJO -Duser.language=cs -Duser.country=CZ" in the JCL
  • The export JZOS_OUTPUT_ENCODING="IBM-870" needs to be added to the JCL as well. IBM-870 is the EBCDIC Latin-2 charset used in Czechia and other central European countries. JZOS_OUTPUT_ENCODING causes JZOS to convert the Unicode output from Java to IBM-870 when it is being written to a single-byte encoding in STDOUT DD
  • Choose IBM-870 as the mainframe codepage in the terminal emulator:
    image
  • Choose a font that supports the central European characters:
    image
  • Display the output without removing special characters - e.g. use BROWSE (B) in the SYSVIEW

Signed-off-by: Petr Plavjanik <plavjanik@gmail.com>
Signed-off-by: Petr Plavjanik <plavjanik@gmail.com>
@plavjanik
Copy link
Contributor Author

Codepage conversion can be difficult in z/OS UNIX without JZOS so there is -Dorg.zowe.commons.logging.stripAccents=true option to remove such characters.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants