iCAx开思网

标题: 請問UF_TEXT_load_translation_file如何使用 [打印本页]

作者: ggyybon    时间: 2010-10-4 09:11
标题: 請問UF_TEXT_load_translation_file如何使用
各位先進:

       小弟最近在做NX二次開發多國語系的支援,
想透過UF_TEXT_load_translation_file()來添加一個.lng檔案,
我使用方法如下:

1.Define UGII_USR_DIR environment variable

2.Put all of your new strings and translation into txt files, ugii_japanese.txt,
     following is the format:


#main dialog -- comment
'Move by Matrix'= <translation string>
'Move Option'=<translation string>
#Cue line -- comment
'Select targets and csys to move'=<translation string>
'Preview Move or copy results'=<translation string>

3. Use nldmgr.exe tool to convert the txt files into related lng files and put into %UGII_USER_DIR%\startup folder
4. Create a small executable library at %UGII_USER_DIR%\startup folder to load the related lng file according to current language setting.

現想透過UF_TEXT_load_translation_file () 來載入.lng檔案卻怎麼嘗試都無法成功變更顯示文字,
不知各位有沒有此Function的使用經驗?該如何才能透過此方式來變更顯示語系文字?



      請各位前輩指點迷津~非常感謝您們的幫忙~謝謝






本帖最后由 ggyybon 于 2010-10-4 09:14 编辑
作者: cam-yp    时间: 2010-10-6 21:39
This is the complete path to the file to be loaded. When
NX displays the user interface, it will use the
contents of this file to try and translate strings into
the users language.

Translation strings that exist in the NX language
file found in $UGII_LANGUAGE/ugii.lng will always be used
first. If a translation is not found in that file, then
this file will be searched.

值得注意的是:在制作LNG文件时,要设置相对的语言格式,简体中文simpl_chinese,繁体中文trad_chinese

NX会自动查找NX自带LNG文件,当找不到时,才会在用户自定义LNG文件中查找
作者: ggyybon    时间: 2010-10-8 16:31
我在製作LNG文件時也都有設置相對的語言格式,但在呼叫UI Styler時上面的顯示文字依然沒變更我載入載入.lng檔案的dll寫法如下:
extern DllExport void ufsta( char *param, int *returnCode, int rlen )
{   
    if( UF_CALL(UF_initialize()) )
    {        
        return;
    }
   
    UF_TEXT_load_translation_file("C:\\tranText\\startup\\aaa.lng")
   
    UF_CALL(UF_terminate());
}


Plug-in如附件,可否請前輩幫我看看哪邊出了差錯

本帖最后由 ggyybon 于 2010-10-8 16:36 编辑




欢迎光临 iCAx开思网 (https://www.icax.net/) Powered by Discuz! X3.3