How to add new language?

User avatar
azimuth
New member
 
Posts: 8
Joined: Tue Jan 29, 2013 08:39

How to add new language?

by azimuth » Tue Jan 29, 2013 09:20

I want to add russian language.
1) Download and build sources
2) Create folder "ru" in "po"
3) Copy po/minetest.pot to po/ru/minetest.po
4) Change po/ru/minetest.po :
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
# Russian translations for minetest-c55 package.
# Copyright (C) 2011 celeron
# This file is distributed under the same license as the minetest-c55 package.
# Azimuth <elagin.pasha@gmail.com>, 2013.
#
msgid ""
msgstr ""
"Project-Id-Version: minetest\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2013-01-29 12:32+0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Azimuth <elagin.pasha@gmail.com>\n"
"Language-Team: Russian <>\n"
"Language: ru\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
...
#: src/guiMainMenu.cpp:248
msgid "Settings"
msgstr "Настройки"
...
#: src/guiMainMenu.cpp:245
msgid "Singleplayer"
msgstr "Одиночная игра"

#: src/guiMainMenu.cpp:246
msgid "Multiplayer"
msgstr "Сетевая игра"
...

5) util$ ./updatepo.sh
[da]: updating strings
.................... завершено.
[de]: updating strings
................... завершено.
[fr]: updating strings
.................... завершено.
[it]: updating strings
................... завершено.
[ru]: updating strings
................... завершено.

6) Run and see in main menu english words.

debug.txt
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
13:08:46: INFO[main]: locale has been set to:ru_RU.UTF-8
 

User avatar
kaeza
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

by kaeza » Tue Jan 29, 2013 09:28

Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

User avatar
azimuth
New member
 
Posts: 8
Joined: Tue Jan 29, 2013 08:39

by azimuth » Tue Jan 29, 2013 10:28

 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Tue Jan 29, 2013 13:41

Have you copiled minetest with gettext? Use
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
cmake . -DENABLE_GETTEXT=1 -DRUN_IN_PLACE=1 && make -j2

The cmake output should tell something like
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
-- GetText enabled; locales found: it;da;fr;de

Also: You dont need to run updatepo.sh, make does this for you.
 

User avatar
azimuth
New member
 
Posts: 8
Joined: Tue Jan 29, 2013 08:39

by azimuth » Tue Jan 29, 2013 14:11

PilzAdam wrote:Have you copiled minetest with gettext? Use
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
cmake . -DENABLE_GETTEXT=1 -DRUN_IN_PLACE=1 && make -j2



Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest$ cmake . -DENABLE_GETTEXT=1 -DRUN_IN_PLACE=1 && make -j4
-- *** Will build version 0.4.4-d1 ***
...
-- GetText enabled; locales found: it;fr;ru;da;de
...
mo-update [de]: Creating locale directory.
[ 17%] mo-update [it]: Creating locale directory.
mo-update [fr]: Creating locale directory.
[ 17%] [ 18%] mo-update [ru]: Creating locale directory.
mo-update [da]: Creating locale directory.
Scanning dependencies of target minetestserver
[ 19%] mo-update [de]: Creating mo file.
[ 20%] mo-update [it]: Creating mo file.
Scanning dependencies of target minetest
[ 21%] [ 21%] mo-update [ru]: Creating mo file.
[ 21%] mo-update [fr]: Creating mo file.
mo-update [da]: Creating mo file.
[ 21%] mo update
[ 21%] [ 21%] Built target translations
...


$ bin/minetest
and see english words
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Tue Jan 29, 2013 14:20

I have the same problem. I have everything correctly compiled and the $LANG varible set to de_DE.UTF-8 but I still get english text.
 

User avatar
azimuth
New member
 
Posts: 8
Joined: Tue Jan 29, 2013 08:39

by azimuth » Tue Jan 29, 2013 19:49

In int main(int argc, char *argv[]) i find
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
init_gettext((porting::path_share+DIR_DELIM+".."+DIR_DELIM+"locale").c_str());


ls -l locale/
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
drwxrwxr-x 3 pavel pavel 4096 янв.  29 20:02 da
drwxrwxr-x 3 pavel pavel 4096 янв.  29 20:02 de
drwxrwxr-x 3 pavel pavel 4096 янв.  29 20:02 fr
drwxrwxr-x 3 pavel pavel 4096 янв.  29 20:02 it

folder "ru" don't exist

After
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
make

folder "ru" has been created

In int main(int argc, char *argv[]) contains:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
init_gettext((porting::path_share+DIR_DELIM+".."+DIR_DELIM+"locale").c_str());


my porting::path_user = : /home/pavel/dev/minetest/bin/..

i change to
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
init_gettext((porting::path_share + DIR_DELIM + "locale").c_str());

and "path" for bindtextdomain = /home/pavel/dev/minetest/bin/../locale

thereafter i change po/ru/minetest.po
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
#: src/guiMainMenu.cpp:245
msgid "Singleplayer"
msgstr "Одиночная игра"
.....
#: src/guiMainMenu.cpp:248
msgid "Settings"
msgstr "Nastroyki"

make && run &&
1) Nothing on "Singleplayer" tab.
2) See "Nastroyki" on "Settings" tab.
Image
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

by sfan5 » Wed Jan 30, 2013 16:01

I just tried out too, it doesn't work for me too.
$LANG is set correctly and gettext compiled in
Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Wed Jan 30, 2013 16:32

Does it actually work for anyone in the latest dev version?
 

User avatar
kaeza
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

by kaeza » Wed Jan 30, 2013 17:53

PilzAdam wrote:Does it actually work for anyone in the latest dev version?

I followed your instructions and got Minetest running with Spanish texts, so I believe the same should hold true for other languages.
And yes, it's the (almost) latest version (a few commits behind).
EDIT: IDK if this works for languages that don't use the latin alphabet (like Russian, Japanese, etc).
Last edited by kaeza on Wed Jan 30, 2013 17:54, edited 1 time in total.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Wed Jan 30, 2013 18:28

I found something: strace outputs:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
open("/home/adam/Minetest/minetest/bin/../../locale/de/LC_MESSAGES/minetest.mo", O_RDONLY) = -1 ENOENT (No such file or directory)

but the file is at
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
"/home/adam/Minetest/minetest/bin/../locale/de/LC_MESSAGES/minetest.mo"

Copying the locale folder from minetest to the parent directory solves the problem.
But why does Minetest look at the wrong place to find the file?
 

User avatar
azimuth
New member
 
Posts: 8
Joined: Tue Jan 29, 2013 08:39

by azimuth » Thu Jan 31, 2013 06:21

PilzAdam wrote:I found something: strace outputs:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
open("/home/adam/Minetest/minetest/bin/../../locale/de/LC_MESSAGES/minetest.mo", O_RDONLY) = -1 ENOENT (No such file or directory)

But why does Minetest look at the wrong place to find the file?

Probably because the string
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
init_gettext((porting :: path_share + DIR_DELIM + ".." + DIR_DELIM + "locale"). c_str ());

is not true.

If it is replaced by
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
init_gettext((porting::path_share + DIR_DELIM + "locale").c_str());

all will be well.

The same line is contained 0.4.3 in and master branch.
 

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

by 4aiman » Mon Mar 04, 2013 21:57

PilzAdam wrote:Have you copiled minetest with gettext? Use
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
cmake . -DENABLE_GETTEXT=1 -DRUN_IN_PLACE=1 && make -j2


did the trick. Well, locales were recognized, russian one selected and then... then I got empty lines instead of text. Do I need to use ttf patch to make cyrillic chars show? Or should I have some ttf file in the particular folder (then - which one?)?
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Tue Mar 05, 2013 14:40

4aiman wrote:
PilzAdam wrote:Have you copiled minetest with gettext? Use
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
cmake . -DENABLE_GETTEXT=1 -DRUN_IN_PLACE=1 && make -j2


did the trick. Well, locales were recognized, russian one selected and then... then I got empty lines instead of text. Do I need to use ttf patch to make cyrillic chars show? Or should I have some ttf file in the particular folder (then - which one?)?

You need to compile minetest with ttf support (i.e. -DENABLE_FREETYPE=1) and use a font that contains the charachters.
Last edited by PilzAdam on Tue Mar 05, 2013 14:40, edited 1 time in total.
 

4aiman
Member
 
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

by 4aiman » Wed Mar 06, 2013 12:12

Thanks, PilzAdam! Will try that.

Edit: Thanks again!
Last edited by 4aiman on Wed Mar 06, 2013 14:38, edited 1 time in total.
 


Return to Minetest Problems

Who is online

Users browsing this forum: No registered users and 23 guests

cron