Opened 10 years ago
Last modified 23 months ago
#11392 new enhancement
Styles, rules and presets translation
Reported by: | stoecker | Owned by: | stoecker |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Core | Version: | |
Keywords: | i18n | Cc: | Don-vip, bastiK, Klumbumbus |
Description
We currently have some translation issues:
- The tr() in styles and rules allows translation, but currently it is impossible to to pass the translated strings to josm
- Meta and test information in styles, rules and presets in wiki can be translated, but it is not done.
- Parsing the stuff and copying it to launchpad is easy, but the reverse way is complicated when don't want to copy it into JOSM core translation.
My current idea to fix all these issues: Support "xx.lang" files in the styles, presets and rules zip files like we do for plugins. This way we can simply attach translations to the wiki pages (e.g as "trans.zip" with UNZIP marker).
When core support is there I'd want to add all these elements from wiki to launchpad for translation.
Attachments (0)
Change History (43)
comment:1 by , 10 years ago
comment:2 by , 10 years ago
Dirk, you know the server scripts and i18n better, but just an idea: Instead of attaching the tans.zip files to the wiki pages, we could simply keep them cached on the server. If you download the style/preset/rule with GET option ?trans=1
, then the translations would be included in the downloaded zip file.
This way we can update the translations automatically and as often as needed without messing with the wiki.
comment:4 by , 10 years ago
Milestone: | → 15.05 |
---|
@bastiK:
Sure that's true. Maybe I'll go that way, but it sounds like it makes outside contribution harder.
OTOH when I auto-attach the translations to the wiki normal non-admins cannot replace the files anyway, so there is no big difference to your proposal. Sounds like the auto-insert is really the better idea. I'd reverse the trans option thought, so that "trans=0" does not include the files :-)
follow-up: 9 comment:8 by , 10 years ago
Replying to stoecker:
@Vincent: I18n is really fast compared to before :-)
Why? I did not think it could be faster, only slower with the increased number of strings and languages.
comment:9 by , 10 years ago
Replying to Don-vip:
Why? I did not think it could be faster, only slower with the increased number of strings and languages.
Because i18n.pl now does the string set reduction instead of gettext tools :-) Even fixes a minor issue in the final files for 2 plugins.
Once in system cache (after the first call on linux) generating .lang files now takes a mere second here. Only the per plugin gettext extract still takes time.
comment:11 by , 10 years ago
Milestone: | 15.05 → 15.06 |
---|
comment:14 by , 10 years ago
Milestone: | 15.08 |
---|
removing from milestone as it seems nobody's working on it right now.
comment:15 by , 9 years ago
Status:
Wiki tasks:
- Finish cleanup of the wiki pages, so that translation and base languages are clear
- Turn on wiki texts extraction when previous point is finished (in i18n dir, coding is already done)
Development tasks JOSM:
- Core support for lang files in styles, presets and rules: Load i18n files also from these file types, not only from plugins.
Development tasks Server:
- Server support to attach translations on download
comment:16 by , 7 years ago
Hi,
here is a zip file for a mapcss validator with translation data included so you can start implementing the missing core file loader :
https://github.com/Jungle-Bus/transport_mapcss/releases/download/0.4-test/transport.validator.zip
comment:17 by , 7 years ago
A short note: The mapcss should be in the root directory, not in the data (although it also will work this way).
comment:20 by , 7 years ago
Does someone else find the right place for I18n.addTextsZip(cache.getFile());
for presets and styles faster than me? I'll have a break now.
comment:22 by , 7 years ago
Milestone: | → 18.03 |
---|
follow-up: 25 comment:24 by , 7 years ago
I'm not sure what to add to wiki:Changelog#stable-release-18.03 regarding this ticket.
comment:25 by , 7 years ago
Replying to Klumbumbus:
I'm not sure what to add to wiki:Changelog#stable-release-18.03 regarding this ticket.
Hmm. "Going secure: Switched half a thousand external http links and JOSM server to https"? :-)
comment:27 by , 7 years ago
"JOSM supports I18N with .lang translation files in external data (styles, rules, presets)"?
comment:29 by , 7 years ago
Anything you want/need to change in JOSM core for this ticket before I release the new version?
comment:31 by , 7 years ago
Milestone: | 18.03 → 18.04 |
---|
comment:32 by , 7 years ago
Milestone: | 18.04 → 18.05 |
---|
comment:34 by , 7 years ago
Owner: | changed from | to
---|
comment:35 by , 7 years ago
Milestone: | 18.05 → 18.06 |
---|
comment:36 by , 7 years ago
Milestone: | 18.06 |
---|
comment:37 by , 5 years ago
What is the status of this ticket?
On TaggingPresets#Tags it is written, that presets are automatically added to Launchpad if baselanguage
is not set and only English text is used. Is this true?
comment:38 by , 5 years ago
Two things:
- It's not live yet, as the quality of the base texts wasn't really fit for it, but it is included in the i18n chain already (and dropped before using it).
- The server code for including the lang files into the final archives is missing
But as far as I remember the first was the main reason for me not to continue.
follow-up: 40 comment:39 by , 5 years ago
We have some really big presets meanwhile. Enabling this feature will probably add thousands of strings?
comment:40 by , 5 years ago
Replying to Klumbumbus:
We have some really big presets meanwhile. Enabling this feature will probably add thousands of strings?
They could be split into another translation context. But even in this case the texts must be sane and proper English.
follow-up: 42 comment:41 by , 4 years ago
comment:42 by , 4 years ago
Replying to skyper:
Translating my monster (diff) was no fun at all and even knowing the syntax it was a burden, took quite some time and I could have easily messed up the code.
Is there any chance to enable translation for external presets, maybe, with a hidden option?
There is no hidden option, but presets can be translated like everything else using the i18n tools of JOSM and adding lang files to the archive. I'm not sure it's less "burden" thought.
comment:43 by , 4 years ago
The major problem is that I do not speak that many languages and by far are able to translate into all languages I speak. Translators on the other hand are often not familiar with source code and probably even less in using lang files.
Full translation support for styles/presets/rules would be great!