8

When you open your Ubuntu, many English words are used. For example, accessories, education, graphics, internet, office, other, sound, video, system tools, preferences, run, and log out will all appear in the GUI.

How can I get a list of all English words used in the Ubuntu GUI?

I want a list of all English words so I can translate them into Chinese, to create a glossary for Ubuntu: a guide in Chinese to English-language Ubuntu terminology. This would work as a mini dictionary: a two-columns file with English on the left and Chinese on the right.

It is a joke to write the whole thing just from looking at the words on the GUI. I want a smart way to do the task. Is there a list of all the words used by Ubuntu?

Screenshot of text editor showing English and Chinese words

Typing by hand as I come across words in the GUI is a foolish way to get the task done.

  1. Copy out all English words one-by-one from the GUI when the locale is set to en_us.
  2. Copy out all Chinese words one-by-one from the GUI when the locale is set to zh.
  3. Put them together in one file, with English on the left and Chinese on the right.

Is there a smarter way to do this?
Which character in my /usr/lib/locale/locale-archive ?

  • 1
    I don't think there is a list somewhere. However, if there is a list, there will also be a list with the corresponding Chinese translation, as Ubuntu is fully translated into Chinese. – Bruni Sep 16 '15 at 12:38
  • Don't know if you already knew, but there is already a chinese version of Ubuntu – AlexGreg Sep 16 '15 at 13:17
  • I knew there is a chinese version,there is chinese dictionay,there is a english dictionay,so there is no need for an english-chinese dictionary? – showkey Sep 16 '15 at 13:19
  • NO,absolutely not. – showkey Sep 16 '15 at 13:19
6
+50

There are many ways which are used to store internationalized strings depending on the GUI toolkits or specifications.

  • The ones shown in the screenshot are from menu .directory files. Use same standard as .desktop from freedesktop project. See Desktop Entry Specification: Localized values for keys

    Here a script to extract them

    1. Create a shell file

      nano extract_zh_translation.sh
      

      Add

      #!/bin/bash            
      
      for f in $(ls $1)
      do
              name_en=`sed -n -e '0,/Name/{s/^\s*Name\s*=\s*//p}' $f`
              name_zh=`sed -n -e '0,/Name\[zh_CN\]/{s/^\s*Name\[zh_CN\]\s*=\s*//p}' $f`
      
              case `echo ${#name_en}/8 | bc` in
              3|2)    echo -e $name_en'\t'$name_zh
                      ;;
              1)      echo -e $name_en'\t\t'$name_zh
                      ;;
              0)      echo -e $name_en'\t\t\t'$name_zh
                      ;;
              esac
      done
      
    2. Make it executable

      chmod +x extract_zh_translation.sh
      
    3. Run it on menu directory entries

      ./extract_zh_translation.sh "/usr/share/desktop-directories/*.directory"
      

      Here is an output sample

    4. If you want application menu entries too

      ./extract_zh_translation.sh "/usr/share/applications/*.desktop"
      

      Here is an output sample

  • Other translations of Unity GUI is using gettext.

    Files having the .gmo or .mo extension, are the final binary format. Check:

    locate -br .mo$ | grep zh_CN
    

    The source files have .po extension, you can download them from https://translations.launchpad.net/ or by downloading the complete source, example:

    apt-get source unity
    
  • Other GUI toolkits like Qt & Java are using different formats.

| improve this answer | |
5

Search for Ubuntu Translations https://wiki.ubuntu.com/Translations/

You can get the Expressions and Translations there.

| improve this answer | |
  • I want to make a mini dictionay : a english-chinese ubuntu glossary,on the left is english ,on the right is chinese, tow columns on the file,it is a joke to write every words looking at the words on the gui ,i want a smart way to do that task. – showkey Sep 16 '15 at 12:48
  • If you register with lanchpad as a tranlator you get acces to the online traslation afaik. There you can copy the english and the translated words. As i am not a translator i cannot cive you the exact information you look for only this hint to look for ubuntu translations which have the lists you are searching for. – Uwe Burger Sep 16 '15 at 13:01
  • This is the only answer at time of writing that seems to be on the right track. Why re-invent the wheel? Get the .mo files for the two languages you want to look at and presto! I suggest an editor like Meld for a 3-way merge to get what you want. – Bobble Sep 23 '15 at 8:57
1

I think he is referring to another problem. On my Ubuntu I have setup English, Hebrew and French. You have to go to System Settings, Language Support and add the additional languages.

To have it boot up in a different language, you drag the preferred language to the top of the list. For me, it works like a charm.

| improve this answer | |
  • no ,not to set locale as chinese ,i just want to make a english-chinese ubuntu terminology to help people to learn both operating system and english language at the same time. – showkey Sep 16 '15 at 12:36
  • I think it is a cool idea. – showkey Sep 16 '15 at 12:37
  • So you want the menu to appear in 2 languages? Don't know how to do that but I use Google translate and it does a rather good job. – Ilan Sep 16 '15 at 12:43
  • He just wants to create a dictionary of terms for Ubuntu. – Bruni Sep 16 '15 at 12:48
0

Start it up in a VM, take screenshots, run a OCR tool on the pictures. This is only a little better than doing it by hand. It would be great if you could just pipe the text into a file, but the os that would do that isnt awake yet.

| improve this answer | |
-1

A chinese version of Ubuntu is available and supported: Ubuntu Kylin

Along with different features, i think a type of this in english but no features removed would be actually pretty good.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.