[p2pu-dev] Fragmented translation strings

Stian Håklev shaklev at gmail.com
Wed Feb 29 21:42:16 UTC 2012


There are a number of places where + is used to concatenate strings, where
string formatting should be used instead, to provide more context for
translators, and enable us to move strings around (word order is rarely the
same).

Two examples:

time_since.py:16
    return timesince(activity.created_on) + _(" ago")

This should be rewritten as _("{1}
ago").format(timesince(activity.created_on))

dashboard.html:29

<p>{{ _('To get started, you should ') }}<a href="{% locale_url
users_profile_edit %}">{{ _('update your profile</a>. This is a great way
to tell people a bit more about yourself. Then find ') }}<a href="{%
locale_url users_user_list %}">{{_('people</a> and ') }}<a href="{%
locale_url projects_gallery %}">{{ _('groups</a> that interest you and
start following them! You can also ') }}<a href="{% locale_url
projects_create %}">{{ _('create new groups</a> and update how often P2PU
') }}<a href="{% locale_url preferences_settings %}">{{_('contacts
you</a>.') }}</p>

this should probably be rewritten like something like this:

_('<p>To get started, you should ') <a href="{1}">update your profile</a>.
This is a great way to tell people a bit more about yourself. Then find <a
href="{2}">people</a> and <a href="{3}>'groups</a> that interest you and
start following them! You can also <a href="{4}">create new groups</a> and
update how often P2PU<a href="{5}">contacts
you</a>.</p>').format(locale_url users_profile_edit, locale_url
users_user_list, locale_url projects_gallery, locale_url
projects_create, locale_url preferences_settings)


On Wed, Feb 29, 2012 at 05:30, Jos Flores <josmasflores at gmail.com> wrote:

> As far as I know (might be wrong!) this is a localisation issue as
> opposed to an internalisation one. The strings in the translation are
> prepared so that the words can be reorganised according to the locale.
> The typical example of dates, here in Europe we generally do dd-mm and
> over in the States generally goes mm-dd, so the composition of strings
> should reflect that for each language (easier said that done though!)
>
> cheers,
> José
>
> On 29 February 2012 10:15, John Britton <john at p2pu.org> wrote:
> > I'm not that familiar with internationalization, but I'd imagine that the
> > case where the string is just "to" is just a linking word as in "10 to
> 20"
> >
> > Translating that one string will only replace instances where the whole
> > string is matched, which means that a long sentence with the word "to"
> in it
> > would get translated separately.
> >
> > I can still see a problem where English might use the word "to" in
> several
> > ways but other languages have multiple words. I'm not really sure what
> to do
> > in that case.
> > --
> > contact info:
> > http://www.johndbritton.com
> > @johndbritton - http://twitter.com/johndbritton
> >
> >
> >
> > On Wed, Feb 29, 2012 at 7:46 AM, Stian Håklev <shaklev at gmail.com> wrote:
> >>
> >> I just spent quite a few hours pouring over the Chinese translations,
> and
> >> submitted a bunch of updated ones
> >> (https://github.com/p2pu/lernanta/pull/97). I haven't even gotten
> through
> >> half yet. However, one thing that is very problematic is that some
> strings
> >> are fragmented and totally out of context. For example this:
> >>
> >> #: templates/badges/_assessment_item.html:11
> >> #: templates/projects/project_edit_status.html:67
> >> #: templates/projects/sidebar.html:145
> >> msgid "to"
> >> msgstr "给"
> >>
> >> It is completely impossible to translate "to" in Chinese, it might be
> very
> >> different things, and probably it should also be somewhere else in the
> >> sentence. I need the whole sentence to be able to translate.
> >>
> >> Here is another example:
> >>
> >> #: templates/badges/_submissions_list_item.html:37
> >> #, fuzzy
> >> msgid "ago"
> >> msgstr "前"
> >>
> >>
> >> Again, the sentence will probably look quite frankensteinian when you
> put
> >> together all these little fragments of Chinese...
> >>
> >> A final example:
> >> #: templates/badges/show_user_awards.html:10
> >> msgid "'s Awards to"
> >> msgstr "对   的授奖"
> >>
> >>
> >> (I have no idea how to translate the upper properly)...
> >>
> >> A lot of these seem to be from the badges section.
> >>
> >> Stian
> >>
> >> --
> >> http://reganmian.net/blog -- Random Stuff that Matters
> >>
> >>
> >> _______________________________________________
> >> p2pu-dev mailing list
> >> p2pu-dev at lists.p2pu.org
> >> http://lists.p2pu.org/mailman/listinfo/p2pu-dev
> >>
> >
> >
> > _______________________________________________
> > p2pu-dev mailing list
> > p2pu-dev at lists.p2pu.org
> > http://lists.p2pu.org/mailman/listinfo/p2pu-dev
> >
> _______________________________________________
> p2pu-dev mailing list
> p2pu-dev at lists.p2pu.org
> http://lists.p2pu.org/mailman/listinfo/p2pu-dev
>



-- 
http://reganmian.net/blog -- Random Stuff that Matters
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p2pu.org/pipermail/p2pu-dev/attachments/20120229/c7c5e19d/attachment.html>


More information about the p2pu-dev mailing list