Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Thank You for your continued support and contributions!

+  Rockbox Technical Forums
|-+  Rockbox General
| |-+  Rockbox General Discussion
| | |-+  How to create a new language file (.lng)
« previous next »
  • Print
Pages: [1] 2

Author Topic: How to create a new language file (.lng)  (Read 11447 times)

Offline vnt87

  • Member
  • *
  • Posts: 3
How to create a new language file (.lng)
« on: February 21, 2009, 11:30:24 PM »
Hey all,
First post here, so be gentle if my question is out of place.
Basically I wanted to create a new language file for my language (vietnamese) since it's not yet available in Rockbox repository.
I've found this page but it seems the instructions are somewhat outdated (for starters, the language files now have the .lng extension instead of .lang).
At any rate, I can't seem to be able to open these .lng using a normal text editor. I'm using Ubuntu Intrepid right now and its default editor (gedit) refuses to open .lng files, displaying some encoding setting errors or something.
I tried notepad++ (through wine) and was able to open them but the text looks messed up.
Any advice here?

trying to reduce width!
« Last Edit: January 12, 2011, 06:01:17 PM by yapper »
Logged

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 8974
Re: How to create a new language file (.lng)
« Reply #1 on: February 21, 2009, 11:34:49 PM »
Quote from: vnt87 on February 21, 2009, 11:30:24 PM
I've found this page but it seems the instructions are somewhat outdated (for starters, the language files now have the .lng extension instead of .lang).

No they still have a .lang extension:

http://svn.rockbox.org/viewvc.cgi/trunk/apps/lang/

Quote from: vnt87 on February 21, 2009, 11:30:24 PM
At any rate, I can't seem to be able to open these .lng using a normal text editor. I'm using Ubuntu Intrepid right now and its default editor (gedit) refuses to open .lng files, displaying some encoding setting errors or something. I tried notepad++ (through wine) and was able to open them but the text looks messed up.
Any advice here?

I don't know anything about rockbox languages, but that wiki says "binary .lng file" so I'm guessing they're binary files and so cannot be viewed in a text editor.   Judging by the example command the wiki gives, I think lang files are compiled into .lng files. 
Logged

Offline vnt87

  • Member
  • *
  • Posts: 3
Re: How to create a new language file (.lng)
« Reply #2 on: February 22, 2009, 12:02:00 AM »
I see, so the .lng files are actually binaries. That explains why the editors couldn't read them. Thanks for pointing me in the right direction. Although, I'm still unsure about the compilation process, the wiki page did not mention anything about .lng files though, or did it? Suppose I have a .lang files translated and ready to go, how do I go about compiling it, does anybody know?
Regards,
NV
Logged

Offline saratoga

  • Developer
  • Member
  • *
  • Posts: 8974
Re: How to create a new language file (.lng)
« Reply #3 on: February 22, 2009, 12:07:33 AM »
Quote from: vnt87 on February 22, 2009, 12:02:00 AM
Suppose I have a .lang files translated and ready to go, how do I go about compiling it, does anybody know?

They'll get made when you compile rockbox.  Theres also some instructions on that page you linked, though I've never tried them myself. 
Logged

Offline vnt87

  • Member
  • *
  • Posts: 3
Re: How to create a new language file (.lng)
« Reply #4 on: February 22, 2009, 12:21:50 AM »
I suppose it means I'd need to compile Rockbox from source then. Hmm it's more of a hassle than I thought. I guess I'll look into it later then, thanks for your clarification.
Logged

Offline yapper

  • Rockbox Expert
  • Member
  • *
  • Posts: 794
Re: How to create a new language file (.lng)
« Reply #5 on: February 22, 2009, 12:25:57 AM »
http://www.rockbox.org/twiki/bin/view/Main/SimpleGuideToCompiling
http://www.rockbox.org/twiki/bin/view/Main/VMwareDevelopmentPlatform
Logged
G2 iPod 20GB / Sansa c240 v1 + 2GB microSD / Sansa c250 v1 / Sansa e250 v1 + 8GB microSDHC / Sansa Fuze v2 + 32GB microSDHC

Offline Lear

  • Developer
  • Member
  • *
  • Posts: 533
Re: How to create a new language file (.lng)
« Reply #6 on: February 24, 2009, 04:00:31 AM »
The binary .lng files are created by the Perl script genlang, found in tools, so you shouldn't need to do a full compile just to be able to test a new translation. The somewhat tricky part is the -t argument; I'm not quite sure what will happen if you don't specify it. Hopefully you'll just get a somewhat larger file than usual (containing strings that aren't relevant for your target).
Logged

Offline antisa

  • Member
  • *
  • Posts: 7
Re: How to create a new language file (.lng)
« Reply #7 on: January 12, 2011, 07:43:04 AM »
Hi guys! Thanks for creating this great software!

Okay, so I'm almost finished with the croatian translation of Rockbox, but before posting it as a patch to Fyspray (that is what one does, right?), I'd like to be able to test it out.

The above command doesn't seem to work anymore because there's a new script called genlang. I've tried to create a .lng file using that command like this:

Code: [Select]
perl genlang -e=english.lang -t=sansafuze:features.txt -i=28 -b=hrvatski.lng hrvatski.lang

This command creates a .lng file, but it doesn't work in Rockbox. I don't understand the part with the "features" and argument "-i" which stands for id number. Where can I find this number? There is a wiki page that talks about translating, and it says that this number is found in the configure script in svn tools/ directory or something like that. I tried running that script in terminal (I use Ubuntu 10.04) but I get this message:

Code: [Select]
antisa@antisa-desktop:~$ ./configure
Using temporary directory /tmp
WEEEEEEEEP. Don't run this configure script within the tools directory.
It will only cause you pain and grief. Instead do this:

 cd ..
 mkdir build-dir
 cd build-dir
 ../tools/configure

Much happiness will arise from this. Enjoy

So if someone can please give me the correct command to execute with genlang that would be great. I have a Sansa Fuze v2.

Thanks in advance!

P.S. I'll be donating some money for this great project, so consider yourselves bribed for an answer ;) :D ;D

Keep up the good work!
Logged

Offline LambdaCalculus

  • Member
  • *
  • Posts: 2257
  • Dreaming of Turing Machines...
    • The Nostalgia Roadtrip
Re: How to create a new language file (.lng)
« Reply #8 on: January 12, 2011, 09:37:44 AM »
For the original poster: this link may be of good use to you.

http://www.rockbox.org/wiki/LangFiles
Logged
Former Rockbox dev. Rising from the ashes...

Players: iPod Video /w 128GB SSD mod, H320 /w 128GB SSD mod

Offline antisa

  • Member
  • *
  • Posts: 7
Re: How to create a new language file (.lng)
« Reply #9 on: January 12, 2011, 09:41:15 AM »
I read that several times, but I don't really get it. Anyone else?
Logged

Offline Domonoky

  • Developer
  • Member
  • *
  • Posts: 205
Re: How to create a new language file (.lng)
« Reply #10 on: January 12, 2011, 12:58:55 PM »
To get the right feature string and the correct id for your target its best to take a look at the .rockbox/rockbox-info.txt file on your mp3player.

It contains all the info you need, the target id in this file is the id you need for the -i parameter.
And the string under Features should be given to the -t parameter. For the -t parameter you also need to add the player name.
So you command should look similar to this:

perl genlang -e=english.lang -t=sansafuze:accessory_supply:alarm:albumart:backlight_brightness:backlight_fade_int:crossfade:dircache:disk_storage:headphone_detection:hold_button:hotkey:lcd_bitmap:lcd_non-mono:lcd_color:lcd_sleep:morse_input:pitchscreen:quickscreen:radio:recording:recording_swcodec:recording_linein:rtc:scrollwheel:serial_port:swcodec:tagcache:tc_ramcache:charging:usb_charging_enable:usb_power:usbstack:usb_hid:usb_hid_mouse:wheel_acceleration:lineout_poweroff:large_plugin_buffer -i=28 -b=hrvatski.lng hrvatski.lang

hope this helps.
Logged

Offline antisa

  • Member
  • *
  • Posts: 7
Re: How to create a new language file (.lng)
« Reply #11 on: January 13, 2011, 07:49:19 AM »
That's it! It works now!

Thanks, a lot. Someone should put this information on that wikipage that describes the translation method.

After I finish the translation, I'll put it up as a patch.

Cheers!
Logged

Offline Chronon

  • Rockbox Expert
  • Member
  • *
  • Posts: 4379
Re: How to create a new language file (.lng)
« Reply #12 on: January 14, 2011, 01:34:36 AM »
I added a note about rockbox-info.txt to that page.
Logged
Sansa e280, Gigabeat F40, Gigabeat S60, Sansa Clip+, iPod Mini 2g

Offline antisa

  • Member
  • *
  • Posts: 7
Re: How to create a new language file (.lng)
« Reply #13 on: January 14, 2011, 08:37:10 AM »
Hm, I ran into a weird problem. I just finished the translation and when I make the .lng file and put it into .rockbox/langs directory on my player some translated strings are shown in wrong places.

For instance, in System menu where you can see the Rockbox info, battery status etc., there are strings from other parts of the translation, that is I don't see the translation for "Battery" which should be in that menu, I see the translated "Buffer" string.

Am I doing something wrong or...?
Logged

Offline torne

  • Developer
  • Member
  • *
  • Posts: 994
  • arf arf
Re: How to create a new language file (.lng)
« Reply #14 on: January 14, 2011, 09:13:47 AM »
Your translation is probably not based on exactly the same version of the Rockbox code as the binary installed on your player. You need to use the same build.
Logged
some kind of ARM guy. ipodvideo/gigabeat-s/h120/clipv2. to save time let's assume i know everything.

  • Print
Pages: [1] 2
« previous next »
+  Rockbox Technical Forums
|-+  Rockbox General
| |-+  Rockbox General Discussion
| | |-+  How to create a new language file (.lng)
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.126 seconds with 14 queries.