forked from LocalGood/Goteo
-
Notifications
You must be signed in to change notification settings - Fork 2
/
TRANSLATOR_NOTES
49 lines (37 loc) · 2.37 KB
/
TRANSLATOR_NOTES
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
== Notes about the i18n work
It's wonderful that Goteo is multilingual from the get go. Most texts
are saved in the database in several languages and Goteo features a
text lookup library to fetch the correct text.
However for some reason this system is not used in the administration
pages. So no matter which language you set on the selector, the
administration panel appears to be in Spanish only. This is far from ideal if
you want to have a non-spanish instance.
I have decided to implement translation of the admin panel using a gettext
derivative because it is a reasonably well understood approach and because it
doesn't use the database. Also, having a standard way of tagging
language dependant texts directly in the source code has the positive
effect of being almost self documenting.
At the moment Goteo has two approaches to fetch language specific texts:
1. Through Text::get('text_id') which fetches the text from the database.
This is used pretty widely in Goteo and uses the built-in translation mechanism
accessible through the admin panel.
2.Through Text::_("Text to fetch") which is an implementation based on gettext .po
files, which is a widely standard. Provides more direct understanding of the code
(messages are looked up by content, not by a reference id).
Having two systems is far from ideal, but while a decission is made which way to
go at least the current implementation includes an admin panel that is not only
in Spanish.
If you want to create your own translation of the admin panel you can start
by editing the file in locale/en_GB/messages.po with PoEdit (or similar tool
for translators). And saving it under the correct locale for your language. For
example if you translate the messages.po file to Greek. The resulting file should
be saved to locale/el_GR/messages.po
To have your language available in the language selector on the top right you
have to add it and enable it in the database. For example, if you want to add
Greek, you can do so by running the following query in your database.
INSERT INTO `lang` VALUES('el', 'Greek', 1, 'ελληνικά', 'el_GR');
That's all there is to it.
You can contribute to the full internationalization of Goteo in several ways.
The simplest is by translating the current .po file into your language. But an
even better way of helping out is by tagging all the hardcoded-spanish text you
encounter with the Text::_() call.