i18n - using tolk

9 views
Skip to first unread message

Claudia Jürgen

unread,
Nov 24, 2011, 10:20:53 AM11/24/11
to bibap...@googlegroups.com
Hi all,

just tried tolk in order to add 2 missing translations to de.yml and
noted 2 small things:

a) inclusion of rails keys
The rails keys for which the translation is not managed via tolk are
displayed as missing keys.
Is it possible to flag these in some way?

Otherwise it might be confusing if you use tolk in order to let
non-technical members of your institution do the customization of a
translation.

Is there a way to manage the text of the default locale? This would be
useful for customizations too.

b) cosmetics
When tolk writes the changes to the locale.yml file a lot of formatting
is done and single words prior quoted are now without quotes, you can
see this in the commit:
https://github.com/cjuergen/BibApp/commit/b19b8b9c317834895970cead83fddb803dcc1852#commitcomment-744447

Have a nice day

Claudia


--
Claudia Juergen
Universitaetsbibliothek Dortmund
Eldorado
0231/755-4043
https://eldorado.tu-dortmund.de/

Claudia Jürgen

unread,
Nov 24, 2011, 10:35:04 AM11/24/11
to bibap...@googlegroups.com
Hi,

I think I wasn't quite precise enough in point a)
Apart from flagging the rails stuff, is it possible to use tolk as a
general text management tool for all the key (not only the missing ones)
and all the locales including the default.

Claudia

Howard Ding

unread,
Dec 1, 2011, 11:18:14 AM12/1/11
to bibap...@googlegroups.com
Hi Claudia,

On 11/24/2011 9:20 AM, Claudia J�rgen wrote:
> Hi all,
>
> just tried tolk in order to add 2 missing translations to de.yml and
> noted 2 small things:
>
> a) inclusion of rails keys
> The rails keys for which the translation is not managed via tolk are
> displayed as missing keys.
> Is it possible to flag these in some way?
>
> Otherwise it might be confusing if you use tolk in order to let
> non-technical members of your institution do the customization of a
> translation.
>
> Is there a way to manage the text of the default locale? This would be
> useful for customizations too.
>

I'll have to look into this stuff. I grafted tolk on because it was
pretty easy to do in order to provide a slightly friendlier way to edit
things than via a text editor (especially for people not really familiar
with the niceties of yaml), but there are ways in which it might not be
a perfect fit and I don't know the work required to make these changes,
which are a bit more fundamental than the customizations that I made.

I suspect it would take some work to make it handle the base locale as
well. Its philosophy is that the programmer manages the strings in the
base locale via the .yml files and that it works off of that for the
other locales.

I think the base locale is set by the value of I18n.default_locale in
the Rails configuration (which means that I've already broken the
previously mentioned assumption by allowing people to change that and
work with tolk - although my unstated idea was that a translator would
install a development instance of Bibapp and work with it with :en as
the default to develop his translation).

I don't know about the Rails strings - I actually thought that I did
something to exclude them already. No, I think I excluded the
personalize strings. So I think what is happening is that when I was
working it was with the default_locale set to :en, which meant that I
didn't have an en.yml file in the rails translation directory since
those are built in, but maybe you have the default locale set to :de and
so it picked up the file there. I'd actually prefer not to deal with
these translations at all via the tolk interface if possible. I know
somewhere out there there is a project with yml files translating the
Rails internals and as much as possible I think it best to encourage
people to just get those and drop them in if they're available. If not
hopefully they can make a translation and contribute back to that
project. This wouldn't help for those who wanted to customize those
strings through Bibapp, but I don't see that as a super critical
feature, as it seems less likely and even so there that file is
relatively small.

> b) cosmetics
> When tolk writes the changes to the locale.yml file a lot of
> formatting is done and single words prior quoted are now without
> quotes, you can see this in the commit:
> https://github.com/cjuergen/BibApp/commit/b19b8b9c317834895970cead83fddb803dcc1852#commitcomment-744447
>
>

This shouldn't be a problem tehcnically. I'm going to assume that the
yaml dumper that tolk uses is smart enough to know when it can dump a
string without quotes and when it needs quoting. Really most of the
values in the .yml files shouldn't need quotes - we just started with them.

Howard

Howard Ding

unread,
Dec 1, 2011, 11:21:34 AM12/1/11
to bibap...@googlegroups.com
On 11/24/2011 9:35 AM, Claudia J�rgen wrote:
> Hi,
>
> I think I wasn't quite precise enough in point a)
> Apart from flagging the rails stuff, is it possible to use tolk as a
> general text management tool for all the key (not only the missing
> ones) and all the locales including the default.
>
> Claudia
>
>
>
See my other answer. I think the answer is "no, but it might be with
some undetermined amount of work".

Howard

Reply all
Reply to author
Forward
0 new messages