OberonCore
https://forum.oberoncore.ru/

Menus files and multiple languages support
https://forum.oberoncore.ru/viewtopic.php?f=130&t=5230
Страница 1 из 1

Автор:  Zinn [ Четверг, 09 Октябрь, 2014 15:48 ]
Заголовок сообщения:  Menus files and multiple languages support

A menus file e.g looks like

MENU "File"
"&New" "N" "StdCmds.New" ""
"&Open..." "O" "HostCmds.Open" ""

and so on ...
But using it for language translation via Strings the "#Subsystem:" name is missing, e.g.

MENU "#System:&File"
"#System:&New" "N" "StdCmds.New" ""
"#System:&Open..." "O" "HostCmds.Open" ""

I won't add the "#Subsystem:" name in front of every menu entries, because the menu file is more readable without.
The questions are:
Should I insert in module HostMenus (4 times) a default subsystem name

IF menu[0] = '#' THEN Dialog.MapString(menu, curMenu.menu)
ELSE Dialog.MapString("#System:"+menu, curMenu.menu)
END;

Which subsystem name should I use? System, Host or another subsystem?
Or should I insert the default Subsystem Name in Dialog.MapString directly?
The same questions arise with Forms.

Автор:  Info21 [ Четверг, 09 Октябрь, 2014 17:45 ]
Заголовок сообщения:  Re: Menus files and multiple languages support

What about native language hotkeys?
Is it a problem of OS -- or BlackBox?

Автор:  Zinn [ Четверг, 09 Октябрь, 2014 18:40 ]
Заголовок сообщения:  Re: Menus files and multiple languages support

No, it is define via the translation in the Rsrc/xx/Strings file.
The letter & is before the hotkey and underlines the hotkey while & is not displayed.
Note: You have to press the Alt key to see underline keys.

Автор:  Иван Кузьмицкий [ Четверг, 09 Октябрь, 2014 19:15 ]
Заголовок сообщения:  Re: Menus files and multiple languages support

No need to change any menus.odc and HostMenus, I think. It's better to modify parser StdMenuTool, procedure Item, which can take a localisation file from subfolder 'YourSubSystem/Rsrc/fr' (for example). If it exists, we can easy get the key from Rsrc/Menus.odc and find local translation within YourSubSystem/Rsrc/fr/Menus.odc. Look how key and tranlsation should match (in my version).

First, we have a menu document "YourSubSystem/Rsrc/Menu.odc" which contains
Код:
MENU "File"
   "&New"   "N"   "StdCmds.New"   ""
...
END


I believe we need to translate the name "&New" to the French. To do this, try to find a "YourSubSystem/Rsrc/fr/Menu.odc", which shall contain
Код:
MENU "File:File"
   "&New:Nouveau"   "N"   "StdCmds.New"   ""
...
END


As you can see, the key is File is followed by a delimiter ":" in the next place a translated term.

How you like the idea?

Автор:  Zinn [ Четверг, 09 Октябрь, 2014 20:28 ]
Заголовок сообщения:  Re: Menus files and multiple languages support

Yes and no.
Yes you show me a better place for change the program (one place instead of four places).
No, because Menus file don't load from the language directory. Menus and Form files always loaded from the Rsrc directory and never from the language directory Rsrc/xx/.

Standard Blackbox (1.6) reads only Strings.odc files from the language directory Rsrc/xx/Strings.odc and nothing else (no Menus and no Forms). The CPC edition expanded to load also Docu files from the language directory Docu/xx/..., but the behaviour about Rsrc/xx/Strings.odc are not changed in the CPC edition.

Автор:  Иван Кузьмицкий [ Четверг, 09 Октябрь, 2014 21:15 ]
Заголовок сообщения:  Re: Menus files and multiple languages support

Zinn писал(а):
Menus and Form files always loaded from the Rsrc directory and never from the language directory Rsrc/xx/.
My proposal is to load Menus from Rsrc, and gain localisation simultaneously from Rsrc/xx/ if one exists. No need to change format of Menus document.

Автор:  Иван Денисов [ Пятница, 10 Октябрь, 2014 11:29 ]
Заголовок сообщения:  Re: Menus files and multiple languages support

http://forum.blackboxframework.org/view ... 1384#p1384

Автор:  Иван Кузьмицкий [ Пятница, 10 Октябрь, 2014 12:49 ]
Заголовок сообщения:  Re: Menus files and multiple languages support

I think my idea is not wellthoughtout :( I'm just starting to plunge in the subject with SDL-host, so this field is very interesting for me.

There are much easier and simpler to keep any of localisation resourses at corresponding subfolder and nothing more to do with translation mechanisms, I believe.

Страница 1 из 1 Часовой пояс: UTC + 3 часа
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/