Modify

Opened 4 years ago

Last modified 6 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 (36)

comment:1 Changed 4 years ago by Klumbumbus

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

comment:2 Changed 4 years ago by bastiK

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 Changed 4 years ago by Don-vip

Keywords: i18n added

Sounds nice, go on :)

comment:4 Changed 4 years ago by stoecker

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 Changed 4 years ago by stoecker

comment:6 Changed 4 years ago by stoecker

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

comment:7 Changed 4 years ago by stoecker

See r8311.

comment:8 in reply to:  6 ; Changed 4 years ago by Don-vip

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 in reply to:  8 Changed 4 years ago by stoecker

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 Changed 3 years ago by Don-vip

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

comment:11 Changed 3 years ago by stoecker

Milestone: 15.0515.06

comment:12 Changed 3 years ago by Don-vip

Milestone: 15.0615.07

skip milestone 15.06

comment:13 Changed 3 years ago by Don-vip

Milestone: 15.0715.08

Milestone renamed

comment:14 Changed 3 years ago by Don-vip

Milestone: 15.08

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

comment:15 Changed 3 years ago by stoecker

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 Changed 9 months ago by nlehuby

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 Changed 9 months ago by stoecker

A short note: The mapcss should be in the root directory, not in the data (although it also will work this way).

comment:18 Changed 9 months ago by stoecker

In 13502/josm:

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

comment:19 Changed 9 months ago by stoecker

In 13503/josm:

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

comment:20 Changed 9 months ago by stoecker

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 Changed 9 months ago by Don-vip

In 13506/josm:

see #11392 - let Dirk enjoy his break

comment:22 Changed 9 months ago by Don-vip

Milestone: 18.03

comment:23 Changed 9 months ago by stoecker

In 13507/josm:

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

comment:24 Changed 8 months ago by Klumbumbus

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

comment:25 in reply to:  24 Changed 8 months ago by stoecker

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 Changed 8 months ago by Klumbumbus

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

comment:27 Changed 8 months ago by stoecker

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

comment:28 Changed 8 months ago by Klumbumbus

Done.

comment:29 Changed 8 months ago by Don-vip

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

comment:30 Changed 8 months ago by stoecker

No.

comment:31 Changed 8 months ago by Don-vip

Milestone: 18.0318.04

comment:32 Changed 7 months ago by Don-vip

Milestone: 18.0418.05

comment:33 Changed 6 months ago by Klumbumbus

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

comment:34 Changed 6 months ago by Don-vip

Owner: changed from team to stoecker

comment:35 Changed 6 months ago by Don-vip

Milestone: 18.0518.06

comment:36 Changed 6 months ago by stoecker

Milestone: 18.06

Modify Ticket

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

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.