Modify

Opened 9 years ago

Last modified 12 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 Klumbumbus, 9 years ago

Full translation support for styles/presets/rules would be great!

comment:2 by bastiK, 9 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:3 by Don-vip, 9 years ago

Keywords: i18n added

Sounds nice, go on :)

comment:4 by stoecker, 9 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 :-)

comment:5 by stoecker, 9 years ago

See [o31111].

comment:6 by stoecker, 9 years ago

@Vincent: I18n is really fast compared to before :-)

comment:7 by stoecker, 9 years ago

See r8311.

in reply to:  6 ; comment:8 by Don-vip, 9 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.

in reply to:  8 comment:9 by stoecker, 9 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:10 by Don-vip, 9 years ago

is this fixed, or is there remaining work to do?

comment:11 by stoecker, 9 years ago

Milestone: 15.0515.06

comment:12 by Don-vip, 9 years ago

Milestone: 15.0615.07

skip milestone 15.06

comment:13 by Don-vip, 9 years ago

Milestone: 15.0715.08

Milestone renamed

comment:14 by Don-vip, 9 years ago

Milestone: 15.08

removing from milestone as it seems nobody's working on it right now.

comment:15 by stoecker, 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 nlehuby, 6 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 stoecker, 6 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:18 by stoecker, 6 years ago

In 13502/josm:

see #11392 - first try to add I18n for external Validators (style, presets still missing)

comment:19 by stoecker, 6 years ago

In 13503/josm:

see #11392 - first try to add I18n for external Validators (style, presets still missing) - forgot revision

comment:20 by stoecker, 6 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:21 by Don-vip, 6 years ago

In 13506/josm:

see #11392 - let Dirk enjoy his break

comment:22 by Don-vip, 6 years ago

Milestone: 18.03

comment:23 by stoecker, 6 years ago

In 13507/josm:

see #11392 - take new shorter I18n implementation also for plugins

comment:24 by Klumbumbus, 6 years ago

I'm not sure what to add to wiki:Changelog#stable-release-18.03 regarding this ticket.

in reply to:  24 comment:25 by stoecker, 6 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:26 by Klumbumbus, 6 years ago

I think you mixed the tickets. This is about external translation.

comment:27 by stoecker, 6 years ago

"JOSM supports I18N with .lang translation files in external data (styles, rules, presets)"?

comment:28 by Klumbumbus, 6 years ago

Done.

comment:29 by Don-vip, 6 years ago

Anything you want/need to change in JOSM core for this ticket before I release the new version?

comment:30 by stoecker, 6 years ago

No.

comment:31 by Don-vip, 6 years ago

Milestone: 18.0318.04

comment:32 by Don-vip, 6 years ago

Milestone: 18.0418.05

comment:33 by Klumbumbus, 6 years ago

Ticket #10426 has been marked as a duplicate of this ticket.

comment:34 by Don-vip, 6 years ago

Owner: changed from team to stoecker

comment:35 by Don-vip, 6 years ago

Milestone: 18.0518.06

comment:36 by stoecker, 6 years ago

Milestone: 18.06

comment:37 by skyper, 4 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 stoecker, 4 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.

comment:39 by Klumbumbus, 4 years ago

We have some really big presets meanwhile. Enabling this feature will probably add thousands of strings?

in reply to:  39 comment:40 by stoecker, 4 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.

comment:41 by skyper, 3 years ago

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?

Last edited 12 months ago by skyper (previous) (diff)

in reply to:  41 comment:42 by stoecker, 3 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.

Last edited 12 months ago by skyper (previous) (diff)

comment:43 by skyper, 3 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.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain stoecker.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from stoecker to the specified user.
Next status will be 'needinfo'. The owner will be changed from stoecker to stoecker.
as duplicate The resolution will be set to duplicate. Next status will be 'closed'. The specified ticket will be cross-referenced with this ticket.
The owner will be changed from stoecker to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.