Skip to content

How to translate the application user interface into yor language

Bohdan SOKRUT edited this page May 4, 2021 · 3 revisions
  1. Make a copy of myfrlang.py
  2. Module myfrlang.py containes a Python dictionary with all interface elemets:

lang = {

"eng": {

    "dir_load_allimg": ["Select a folder with reference pictures",

                       "Attention!", "Can't create working folder %s",

                       "Information", "Added %d face(s) from %d  pictures at %s. Saving encodings to file..."],

    "dir_load_allimg_sub": ["Select a folder with reference pictures",

                            "Attention!", "Can't create working folder %s",

                            "Information", "Added %d face(s) from %d  pictures at %s. Saving encodings to file..."],

...

  1. All you need is to copy "eng" key:value section, translate all phrases in place and paste as a new lang dictionary key:value. For example, make a "rus" root key and translate all phrases in []:

    "rus": {

     "dir_load_allimg": ["Выберите папку со справочными изображениями",
    
                        "Внимание!", "Не могу создать рабочую папку %s",
    
                        "Информация", "Добавлено %d лиц из% d изображений в %s. Сохранение кодировок в файл ... "],
    
     "dir_load_allimg_sub": ["Выбрать папку со справочными изображениями",
    
                             "Внимание!", "Не могу создать рабочую папку %s",
    
                             "Информация", "Добавлено %d лиц из %d изображений в %s. Сохранение кодировок в файл ..."],
    

...

  1. Make a copy of fr_eng.py. Find

#################################

lang = "eng" # Language selector

#################################

and change

#################################

lang = "rus" # Language selector

#################################

  1. That's all you need to do.
Clone this wiki locally