Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » A quick method of editing text translations
A quick method of editing text translations [message #1821078] Wed, 05 February 2020 10:15 Go to next message
Krzysztof Leja is currently offline Krzysztof LejaFriend
Messages: 55
Registered: April 2019
Member
Hi,
I don't know if this is a Scout plug-in or other Eclipse plug-in problem, but it has been bothering me for a long time and I finally decided to share it with you, because maybe you will have a tip on how to solve it.

In my Scout 9 application I use the default way of text internationalization, i.e. using the TEXTS.get("TextId") method.
There is a nice feature in Eclipse: if I move the cursor at the end of message key and before the closing apostrophe (in the example above it will be after TextId) and press CTRL + space on the keyboard, then a hint window is displayed, where I can:
- add translations for this key ("New text..." option)
- view current translations for all languages, if they have been previously added

This is a great thing that speeds up the internationalization of texts. However, it lacks one thing, i.e. editing already added translations in this hint window. Currently, when I want to do this, I need to copy the text key, search for it in all Texts*.properties translation files in the * .shared module and change the mapping for them there.

Is there a simpler method of changing translations, similar to the above mentioned for adding new translations from the hint window?
Re: A quick method of editing text translations [message #1821080 is a reply to message #1821078] Wed, 05 February 2020 10:23 Go to previous messageGo to next message
Andre Wegmueller is currently offline Andre WegmuellerFriend
Messages: 204
Registered: September 2012
Location: Baden-Dättwil, Switzerla...
Senior Member
Hi Krzysztof

The Scout SDK provides an editor to manage all text translations. See here:
https://help.eclipse.org/2019-12/index.jsp?topic=%2Forg.eclipse.scout.sdk.s2e.doc%2Fhtml%2Fsdk_editor_nls.html

When you've created your own TextProvider and text .properties file in your module, you can add a .nls file to the root directory of that module.
This file points to your TextProvider (FQN). Now you can double-click on that file and the NLS Editor should open.

Example:
################################################
# This file is maintained by the nls editor.   #
# To ensure a properly working nls support     #
# keep this file untouched.                    #
################################################
Nls-Class=org.example.ui.html.UiTextProviderService


Cheers
André


Eclipse Scout Homepage | Documentation | GitHub
Re: A quick method of editing text translations [message #1821083 is a reply to message #1821080] Wed, 05 February 2020 10:40 Go to previous messageGo to next message
Krzysztof Leja is currently offline Krzysztof LejaFriend
Messages: 55
Registered: April 2019
Member
Thanks Andre.
This is a slightly faster method of changing translations for multiple languages than manually modifying each translation file separately. I will use it.

I understand that in the proposal editor window mentioned above (opened via CTRL + space) it is not possible to edit the translation directly.
I do not find this option in the help (Eclipse Scout User Guide> Scout Tooling -> NLS-Entry support).
It would be nice to add such an editing option in this window - certainly many people would use it, because in my opinion it would be the fastest, contextual method for changing translations.
Re: A quick method of editing text translations [message #1821089 is a reply to message #1821083] Wed, 05 February 2020 11:47 Go to previous message
Andre Wegmueller is currently offline Andre WegmuellerFriend
Messages: 204
Registered: September 2012
Location: Baden-Dättwil, Switzerla...
Senior Member
Quote:
I understand that in the proposal editor window mentioned above (opened via CTRL + space) it is not possible to edit the translation directly.


Correct, that's not possible.

Thanks for your proposal, we keep that in mind :) In our own projects translation is often out-sourced to a translation agency. Which means the NLS-Editor is used to export an Excel file, the agency makes the translations in Excel and finally the developer re-imports the translated Excel back into the NLS-Editor.


Eclipse Scout Homepage | Documentation | GitHub
Previous Topic:Aggregating columns in a table according to a different algorithm than the one built-in
Next Topic:Restoring closed form in panel navigation tree
Goto Forum:
  


Current Time: Sun Nov 10 19:41:37 GMT 2024

Powered by FUDForum. Page generated in 0.02887 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top