Skip to content
This repository has been archived by the owner on Jul 24, 2021. It is now read-only.

Split the default English i18n parameter in Potlatch out to a YAML file so we can have a machine-readable version of canonical UI messages #2304

Closed
openstreetmap-trac opened this issue Jul 23, 2021 · 2 comments

Comments

@openstreetmap-trac
Copy link

Reporter: avarab[at]gmail.com
[Submitted to the original trac issue database at 10.19am, Wednesday, 23rd September 2009]

Potlatch needs to split the default English i18n parameter in Potlatch out to a YAML file so we can have a machine-readable version of canonical UI messages. This is required so that we don't have to manually track down translation strings in Potlatch's source and [http://wiki.openstreetmap.org/index.php?title=Template:Potlatch/Translation&diff=302899&oldid=302884 add them to the wiki] so that they can be translated via the ad-hoc i18n template.

Attached is a patch that shows the sort of internal changes that need to happen. The English language strings that are removed from the source then need to be added to an English localised.yaml [http://trac.openstreetmap.org/browser/sites/rails_port/config/potlatch/localised/da/localised.yaml like other languages have], currently [http://trac.openstreetmap.org/browser/sites/rails_port/config/potlatch/localised/en there isn't one].

If this is done we can easily add Potlatch to a better i18n system like Translatewiki.

@openstreetmap-trac
Copy link
Author

Author: Richard
[Added to the original trac issue at 10.54am, Wednesday, 23rd September 2009]

I agree this would be a useful enhancement, but in the absence of any sudden influx of Potlatch 1 developers, I don't see it as a higher priority than working on Potlatch 2.

@openstreetmap-trac
Copy link
Author

Author: avarab[at]gmail.com
[Added to the original trac issue at 6.45pm, Wednesday, 23rd September 2009]

So I've implemented this in a bunch of commits, most notably [17775].

But it broke everything, or rather exposed the breakage that was already there.

When Potlatch starts up it seems to output some messages with iText before it actually loads them from the server, i.e. before it calls loadPresets(). Since English isn't hardcoded in the UI anymore those messages will just get "I18N ERR" in the current trunk.

However if you click around in the UI and cause something to re-draw you'll get the message you wanted, e.g. here: attachment:pl-i18n-err.png

Before I maximized & un-maximized the "Maximize window" message was also displayed as "I18N ERR".

So Potlatch needs to change to re-draw the UI after it has loaded i18n, or load i18n before it draws the UI.

If that's all unpossible I can just implement a hack to shuffle the hardcodings into the ActionScript code from the YAML file and restore the status quo.

But as is I've broken Potlatch in trunk. Just revert it if there's not some really silly redrawUI() function I'm missing.

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

No branches or pull requests

1 participant