<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi TomH and developers,<br>
<br>
Thank you comment.<br>
Trac is not a discussion forum, so I move discussion on ml.<br>
<br>
(2011年09月19日 18時01分45秒), OpenStreetMap wrote:<br>
<blockquote type="cite"><br>
#4010: i18n: make map_features i18n-ed<br>
-------------------------+--------------------------------------------------<br>
Reporter: miurahr | Owner: potlatch-dev@… <br>
Type: enhancement | Status: new <br>
Priority: minor | Milestone: <br>
Component: potlatch2 | Version: <br>
Keywords: | <br>
-------------------------+--------------------------------------------------<br>
<br>
Comment(by TomH):<br>
<br>
This is certainly needed, though there are various approaches to
doing it.<br>
</blockquote>
<br>
Yes it is.<br>
I consider pros and cons about 2 approaches.<br>
<br>
approach 1. inject translated message using mechanism of babelFX.<br>
approach 2. loading definition xml according to language.<br>
<br>
pros.<br>
<br>
for 1. - consistent approach.<br>
- localize contributer only see properties files.<br>
<br>
for 2. - we can change features menu according to language/region.<br>
- easy to maintain for localize contributers.<br>
- It can also use Flashvars passed on SWF loading.<br>
(To catch its value, I need to consume many hours but now
realize it:)<br>
- I have realized it:)<br>
<br>
about flashvar; see.
<a class="moz-txt-link-freetext" href="https://github.com/osmfj/potlatch2/commit/5e0d5f25bc69df3ddc8c86fd576fd7eb2989d6a3">https://github.com/osmfj/potlatch2/commit/5e0d5f25bc69df3ddc8c86fd576fd7eb2989d6a3</a><br>
<br>
cons.<br>
<br>
for 1. - difficulties for implement; to inject we need unique 'id'
for each icons but now<br>
it is put with static mxml(TagViewer.mxml) using mx:repeater so<br>
it can NOT add unique 'id' to each icons. <br>
<br>
-because property key would be generated by some logic in above
reason,<br>
programmers need to update LocaleMap when map_features.xml
updated.<br>
(It is totally boring work!!!!)<br>
<br>
- big problem: I have never realized it yet. :)<br>
<br>
for 2. - duplicate; all laungage need map_feature-<lang>.xml
file that may be equal other than<br>
tranlation. <br>
-- but that is not big problem because we can reduce size of
map_feature.xml file<br>
using include nested xml files.<br>
<br>
<br>
<blockquote type="cite"><br>
At one extreme the OSM web site could already do it by passing an<br>
appropriate parameter to the SWF based on what files are
available, or we<br>
could do as your patch does and make the SWF do the job.<br>
</blockquote>
<br>
Both approach use it. no problem. This is NOT configured on XML but<br>
SWF parameters.<br>
<br>
<blockquote type="cite"><br>
We may need to think about how this interacts with the resource
bundling<br>
stuff, and whether we should actually be loading a zip named after
the<br>
locale and then looking for map_features.xml inside it, along with
the<br>
icons etc.<br>
<br>
</blockquote>
<br>
It is independent with resource bundling. As I wrote above. <br>
<br>
<blockquote type="cite"> I'm certainly not sure that we just want to
duplicate the existing english<br>
</blockquote>
<br>
Not only duplicate. We may be able to reduce size that needed to
localize for minimum<br>
<br>
<blockquote type="cite"> stylesheet to all the languages - it would
be better to fallback to the<br>
</blockquote>
<br>
There are not stylesheet difference. It is top of definition files.<br>
Many of icons, css and stylesheets are common for all languages.<br>
<br>
<blockquote type="cite"> english version somehow until there is a
locale specific version. We may<br>
also want more granular fallback I guess but that's a hard problem
I<br>
think.<br>
<br>
</blockquote>
<br>
This patch is not to make localized version but try to make i18n-ed
scheme.<br>
We share all of code in every languages and only switching
configuration.<br>
<br>
<br>
Please see here:<br>
<br>
<a class="moz-txt-link-freetext" href="https://github.com/osmfj/potlatch2/blob/miurahr_i18n-features/resources/map_features/map_features-ja_JP.xml">https://github.com/osmfj/potlatch2/blob/miurahr_i18n-features/resources/map_features/map_features-ja_JP.xml</a><br>
<br>
category definitions and includes are language dependent.<br>
only inputsets are duplicated.<br>
<br>
Because it is common for all languages, we may be able to put it as
common includes xml file.<br>
<br>
Next is on each definitions. <br>
<br>
<a class="moz-txt-link-freetext" href="https://github.com/osmfj/potlatch2/blob/miurahr_i18n-features/resources/map_features/shopping-ja_JP.xml">https://github.com/osmfj/potlatch2/blob/miurahr_i18n-features/resources/map_features/shopping-ja_JP.xml</a><br>
<br>
You pointed out many part is common for languages.<br>
But I don't think so.<br>
<br>
for example.<br>
<br>
= current implementation.<br>
<pre><div style="background-color: transparent;" class="line" id="LC1"><span class="nt"><featureGroup>
</span></div><div style="background-color: transparent;" class="line" id="LC2"> <span class="nt"><feature</span> <span class="na">name=</span><span class="s">"super market"</span><span class="nt">></span></div><div style="background-color: transparent;" class="line" id="LC3"> <span class="nt"><category></span>shopping<span class="nt"></category></span></div><div style="background-color: transparent;" class="line" id="LC4"> <span class="nt"><icon</span> <span class="na">image=</span><span class="s">"features/pois/shopping_supermarket.n.24.png"</span><span class="nt">></span></div><div style="background-color: transparent;" class="line" id="LC5"> ${name}</div><div style="background-color: transparent;" class="line" id="LC6"> <span class="nt"></icon></span></div><div style="background-color: transparent;" class="line" id="LC7"> <span class="nt"><help></span><a class="moz-txt-link-freetext" href="http:/
/wiki.openstreetmap.org/wiki/Tag:shop%3Dsupermarket">http://wiki.openstreetmap.org/wiki/Tag:shop%3Dsupermarket</a><span class="nt"></help></span></div><div style="background-color: transparent;" class="line" id="LC8"> <span class="nt"><point/></span></div><div style="background-color: transparent;" class="line" id="LC9"> <span class="nt"><area/></span></div><div style="background-color: transparent;" class="line" id="LC10"> <span class="nt"><tag</span> <span class="na">k=</span><span class="s">"shop"</span> <span class="na">v=</span><span class="s">"supermarket"</span><span class="nt">/></span></div><div style="background-color: transparent;" class="line" id="LC11"> <span class="nt"><inputSet</span> <span class="na">ref=</span><span class="s">"names"</span><span class="nt">/></span></div><div style="background-color: transparent;" class="line" id="LC12"> <span class="nt"><inputSet</span> <span class="na">ref=
</span><span class="s">"web"</span><span class="nt">/></span></div><div style="background-color: transparent;" class="line" id="LC13"> <span class="nt"><inputSet</span> <span class="na">ref=</span><span class="s">"buildingAddress"</span><span class="nt">/></span></div><div style="background-color: transparent;" class="line" id="LC14"> <span class="nt"><inputSet</span> <span class="na">ref=</span><span class="s">"common"</span><span class="nt">/></span></div><div style="background-color: transparent;" class="line" id="LC15"> <span class="nt"></feature>
== how difference for languages
</span><pre><div style="background-color: transparent;" class="line" id="LC1"><span class="nt"><featureGroup></span></div><div style="background-color: transparent;" class="line" id="LC2"> <span class="nt"><feature>
<name="super market">
</span> <span class="na"><name_ja=</span><span class="s">"スーパーマーケット"</span><span class="nt">>
<name_de="....">
</span></div><div style="background-color: transparent;" class="line" id="LC3"> <span class="nt"><category></span>shopping<span class="nt"></category><!-- this is 'id' of category --></span></div><div style="background-color: transparent;" class="line" id="LC4"> <span class="nt"><icon</span> <span class="na">image=</span><span class="s">"features/pois/shopping_supermarket.n.24.png"</span><span class="nt">></span></div><div style="background-color: transparent;" class="line" id="LC5"> ${name}</div><div style="background-color: transparent;" class="line" id="LC6"> <span class="nt"></icon>
</span><pre><pre><div style="background-color: transparent;" class="line" id="LC4"> <span class="nt"><icon</span> <span class="na">image=</span><span class="s">"features/pois/shopping_supermarket.n.24-ja.png"</span><span class="nt">></span></div><div style="background-color: transparent;" class="line" id="LC5"> ${name_ja}</div><div style="background-color: transparent;" class="line" id="LC6"> <span class="nt"></icon><!-- Some country use another icon for their renderer --></span></div></pre></pre></div><div style="background-color: transparent;" class="line" id="LC7"> <span class="nt"><help lang="en_US"></span><a class="moz-txt-link-freetext" href="http://wiki.openstreetmap.org/wiki/Tag:shop%3Dsupermarket">http://wiki.openstreetmap.org/wiki/Tag:shop%3Dsupermarket</a><span class="nt"></help>
</span><pre><pre> <span class="nt"><help lang="ja_JP"></span><a class="moz-txt-link-freetext" href="http://wiki.openstreetmap.org/wiki/Tag:JA:shop%3Dsupermarket">http://wiki.openstreetmap.org/wiki/Tag:JA:shop%3Dsupermarket</a><span class="nt"></help>
<!-- help is localized wiki -->
</span></pre></pre></div><div style="background-color: transparent;" class="line" id="LC8"> <span class="nt"><point/></span></div><div style="background-color: transparent;" class="line" id="LC9"> <span class="nt"><area/></span></div><div style="background-color: transparent;" class="line" id="LC10"> <span class="nt"><tag</span> <span class="na">k=</span><span class="s">"shop"</span> <span class="na">v=</span><span class="s">"supermarket"</span><span class="nt">/></span></div><div style="background-color: transparent;" class="line" id="LC11"> <span class="nt"><inputSet</span> <span class="na">ref=</span><span class="s">"names"</span><span class="nt">/></span></div><div style="background-color: transparent;" class="line" id="LC12"> <span class="nt"><inputSet</span> <span class="na">ref=</span><span class="s">"web"</span><span class="nt">/></span></div><div style="background-color: transparent;" class="line" id="L
C13"> <span class="nt"><inputSet</span> <span class="na">ref=</span><span class="s">"buildingAddress"</span><span class="nt">/></span></div><div style="background-color: transparent;" class="line" id="LC14"> <span class="nt"><inputSet</span> <span class="na">ref=</span><span class="s">"common"</span><span class="nt">/><!-- totally common part --></span></div><div style="background-color: transparent;" class="line" id="LC15"> <span class="nt"></feature></span></div></pre>Common parts are not big share. we are only share inputSet as common part.
Spliting files for languages make translators easy to deal with.
</div></pre>
Hiroshi<br>
<br>
--<br>
Hiroshi Miura<br>
representative of OpenStreetMap Foundation Japan<br>
sub leader of sinsai.info - Ushahidi4Japan<br>
<br>
<br>
</body>
</html>