You Are Here:

Community: Developer Discussion Boards

Reply « Previous Thread | Next Thread »

#1 Old 上下文相关帮助本地化方案 - 2006-03-31, 13:37

Join Date: Feb 2004
Posts: 1,928
r60600
Offline
Super Contributor
  上下文相关帮助(Context Sensitive Help)可以根据用户选择显示相应的帮助,用于解决在操作过程中所遇到的疑难问题。在实际当中,某个应用的使用者可能来自不同的国家和地区,使用着不同的语言文字,有着不同的习惯。如果我们希望自己开发的应用获得最大的用户群,则必须在用户界面(UI)的设计上考虑到这一可能的事实。为不同国家和地区的潜在用户设计适合其使用的界面便成了开发者们必然的选择,这在Symbian /C++开发中被称之为“本地化”(Localization)。

  本地化应用不同于平时所用的电脑中的那些不同语言版本的同一软件,(例如英文版、简体中文版、繁体中文版)。也并非真的为每个语种设计单独的用户界面或单独应用,而是针对同一用户界面在不同语种环境中的不同要求而做一些变化。其基本原理就是,根据设备的语言设置调用其相应的经过编译的资源文件,以合成适合该语种的用户界面,使得应用象专门为使用该语言的人群而设计的一样。最典型的应用是对用户界面组件中显示字串的本地化,也就是%EPOCROOT%\Examples\toolsandutilities\localize\和%EPOCROOT%\Series60Ex\language\这两个例程中所做的那样。

  不过在应用中不仅是字串有本地化的要求,同样被要求的还有帮助、图标、图片,甚至是动画、音频、视频。当然,动画、音频、视频的本地化在现今的硬件条件下我个人不主张,因为那样做会使应用占据过多的存储空间,这对在资源受限设备上的开发来说是不利的。图标、图片倒还可以接受,但即便是本地化图标和图片,它们也应该尽量小和少。

  可是帮助不同于以上所说的资源,它基本上只是些文本,只要语言精练就占不了多大空间,所以帮助本地化和字串本地化是很类似的,特别是当用简单的弹出对话框显示帮助则几乎完全是一回事,也就是字串长度长一些。但如果涉及到上下文相关帮助的本地化,其和单纯的字串本地化相比,虽然基本原理相同,但所采用的具体方法就有所区别了。

  用过上下文相关帮助的开发者都知道,首先应该为应用建立帮助源文件(.rtf),以及帮助项目文件(.cshlp)和可选的样式自定义文件(custom.xml),通过cshlpcmp编译后会生成相应的帮助文件(.hlp)和帮助标志头文件(.hlp.hrh)。在应用中程序会根据用户选择调用CCoeAppUi::AppHelpContextL, 之后系统会利用帮助标志作为参数调用被覆盖的CCoeAppUI::HelpContextL或CCoeControl::GetHelpContext方法从帮助文件中获取该标志所标识的帮助内容,再通过HlpLauncher::LaunchHelpApplicationL显示相应的帮助。

  那怎样本地化帮助呢?根据本地化的一般方法,开发者必须为不同的语种建立不同的帮助,也就是为同一帮助项建立不同语种的内容。众所周知,系统必须通过帮助标志才能在帮助文件中找到相应的帮助内容。而帮助标志是什么?从帮助标志头文件中可以获知,它们其实是上下文的字串描述符,也就是一些字串。基于以上情况,我们完全可以舍弃帮助标志头文件,而直接在资源文件中建立相应的帮助标志字串资源,模仿%EPOCROOT%\Series60Ex\language\这个例程,通过本地化帮助标志字串,来实现上下文相关帮助的本地化。

  下面就以Series 60 2nd Edition SDK for Symbian OS Supporting Feature Pack 3 for C++中大家所熟知的例程Help Example为基础(之所以选择这个SDK是因为其支持简体中文),对其进行中文简体本地化,籍此来谈谈上下文相关帮助的本地化。

  首先,为不同语种建立不同的帮助源文件,即.rtf文件,用不同的帮助标志作为区别。将%EPOCROOT%\Series60Ex \helpexample\help\下的helpexample.rtf更名为helpexample01.rtf,内容作如下修改(主要是帮助标志):
Code:

Author: Nokia
Date: 23 July 2002
Version: 1


HelpExample


0x10005B93


Application Help
ContextApplication01 The Application
i	HelpExample Application
When there are no controls in focus with help available, this message is shown.

Helpful Form
ContextHelpfulForm01 The form
i	HelpExample Form
This is a form implementing context-sensitive help.  Special help is available when the first two controls have focus. This message is shown otherwise. 

Edwin 1
ContextEdwin101 Control 1 on form
i	HelpExample Edwin 1
This is help for the first control on the form.

Edwin 2
ContextEdwin201 Control 2 on form
i	HelpExample Edwin 2
This is help for the second control on the form.
  然后将helpexample01.rtf另存为helpexample31.rtf,内容修改为简体中文的帮助:
Code:

Author: Nokia
Date: 23 July 2002
Version: 1


HelpExample


0x10005B93


应用帮助
ContextApplication31 The Application
i	帮助示例应用
当获得焦点的控制没有可用帮助时显示此信息。

帮助表格
ContextHelpfulForm31 The form
i	帮助示例表格
这是一个执行上下文相关帮助的表格。当前两个控制获得焦点时会有相应的帮助。此信息在例外的情况下显示。

编辑框一
ContextEdwin131 Control 1 on form
i	帮助示例编辑框一
这是表格中控制一的帮助。

编辑框二
ContextEdwin231 Control 2 on form
i	帮助示例编辑框二
这是表格中控制二的帮助。
  相应的帮助项目文件helpexample.cshlp修改为:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<?xml:stylesheet href="..\..\..\epoc32\tools\cshlpcmp\xsl\CSHproj.xsl" title="CS-Help project" type="text/xsl"?>
<!DOCTYPE cshproj SYSTEM "..\..\..\epoc32\tools\cshlpcmp\dtd\cshproj.dtd">

<cshproj>
  <helpfileUID>0x10005B94</helpfileUID>
  <directories>
    <input></input>
    <output></output>
    <graphics>pictures/</graphics>
    <working></working>
  </directories>
  <files>
    <source>
      <file>HelpExample01.rtf</file>
      <file>HelpExample31.rtf</file>
    </source>
    <destination>HelpExample.hlp</destination>
	<customization>custom.xml</customization>
  </files>
</cshproj>
  可选的样式自定义文件custom.xml在此无须修改。
  接着修改%EPOCROOT%\Series60Ex \helpexample\Group\helpexample.mmp
Code:
/* Copyright (c) 2004, Nokia. All rights reserved */

TARGET          HelpExample.app
TARGETTYPE      app
UID             0x100039CE 0x10005B93
TARGETPATH      \system\apps\helpexample

.
.
.

SOURCEPATH      ..\help
DOCUMENT        HelpExample01.rtf
DOCUMENT        HelpExample31.rtf
DOCUMENT        HelpExample.cshlp
DOCUMENT        Custom.xml

.
.
.

LIBRARY         euser.lib
LIBRARY         apparc.lib
LIBRARY         cone.lib 
LIBRARY         eikcore.lib  
LIBRARY         avkon.lib
LIBRARY         eikdlg.lib
LIBRARY         eikcoctl.lib
LIBRARY         hlplch.lib

LANG            01 31

AIF             HelpExample.aif ..\aif HelpExampleAif.rss c12 qgn_help_demo_cxt.bmp qgn_help_demo_cxt_mask.bmp qgn_help_demo_lst.bmp qgn_help_demo_lst_mask.bmp
Reply With Quote

#2 Old 上下文相关帮助本地化方案 - 2006-03-31, 13:39

Join Date: Feb 2004
Posts: 1,928
r60600
Offline
Super Contributor
  因为不再使用帮助标志头文件HelpExample.hlp.hrh,所以%EPOCROOT%\Series60Ex \helpexample\data\中的helpexample.rss必须加入新的帮助标志字串资源,%EPOCROOT%\Series60Ex \helpexample\data\helpexample.rss
Code:
/* Copyright (c) 2004, Nokia. All rights reserved */

NAME HELP

// INCLUDES
#include <eikon.rh>
#include <avkon.rh>
#include <avkon.rsg>

#include "HelpExample.hrh"
#include "HelpExample.loc"

// RESOURCE DEFINITIONS
// ----------------------------------------------------------------------------
//   
//    Define the resource file signature 
//    This resource should be empty.
//
// ----------------------------------------------------------------------------
//
RESOURCE RSS_SIGNATURE {}

.
.
.

RESOURCE DIALOG r_helpful_dialog
    {
    
     .
     .
     .


    }

// ----------------------------------------------------------------------------
//   
//   r_helpful_dialog_form
//   Form with three entries, 2 of which will provide context 
//   sensitive help
//
// ----------------------------------------------------------------------------
//
RESOURCE FORM r_helpful_dialog_form
    {
    items =
        {
        
         .
         .
         .

        };
    } 
//帮助标志字串资源
RESOURCE TBUF32 r_kca { buf=qtn_kca; }
RESOURCE TBUF32 r_kce1 { buf=qtn_kce1; }
RESOURCE TBUF32 r_kce2 { buf=qtn_kce2; }
RESOURCE TBUF32 r_kchf { buf=qtn_kchf; }
// End of File
  之后通过同一目录的字串文件实现帮助标志字串的本地化,将helpexample.loc另存为helpexample.l01并修改为:
Code:
/* Copyright (c) 2004, Nokia. All rights reserved */


// LOCALISATION STRINGS

// MENU TEXTS

//d:Command in options list.
//d:Show form.
#define qtn_help_helpexample_ShowForm "Show Form"

//d:Command in options list.
//d:Help.
#define qtn_help_helpexample_Help "Help"

//d:Command in options list.
//d:Exit.
#define qtn_help_helpexample_Exit "Exit"

// OPTIONS TEXTS IN VIEWING FORM

//d: Menu for "Options" when in viewing form
//d: Help
#define qtn_help_helpexample_ViewHelp "Help"

//d:Caption string for app.
#define qtn_help_caption_string "Help Example"

//d:Short caption string for app.
#define qtn_help_short_caption_string "Help"

// d:Dialog Form.
// d: Names listed in Dialog.
#define qtn_help_dialog1_prompt "Edwin 1"
#define qtn_help_dialog2_prompt "Edwin 2"
#define qtn_help_dialog3_prompt "Edwin 3"

//帮助标志字串
#define qtn_kca "ContextApplication01"
#define qtn_kce1 "ContextEdwin101"
#define qtn_kce2 "ContextEdwin201"
#define qtn_kchf "ContextHelpfulForm01"

// End of File
  再将helpexample.l01用UTF-8编码另存为helpexample.l31,写入简体中文字串:
Code:
/* Copyright (c) 2004, Nokia. All rights reserved */


// LOCALISATION STRINGS

// MENU TEXTS

//d:Command in options list.
//d:Show form.
#define qtn_help_helpexample_ShowForm "显示表格"

//d:Command in options list.
//d:Help.
#define qtn_help_helpexample_Help "帮助"

//d:Command in options list.
//d:Exit.
#define qtn_help_helpexample_Exit "退出"

// OPTIONS TEXTS IN VIEWING FORM

//d: Menu for "Options" when in viewing form
//d: Help
#define qtn_help_helpexample_ViewHelp "帮助"

//d:Caption string for app.
#define qtn_help_caption_string "帮助示例"

//d:Short caption string for app.
#define qtn_help_short_caption_string "帮助"

// d:Dialog Form.
// d: Names listed in Dialog.
#define qtn_help_dialog1_prompt "编辑框一"
#define qtn_help_dialog2_prompt "编辑框二"
#define qtn_help_dialog3_prompt "编辑框三"

//帮助标志字串
#define qtn_kca "ContextApplication31"
#define qtn_kce1 "ContextEdwin131"
#define qtn_kce2 "ContextEdwin231"
#define qtn_kchf "ContextHelpfulForm31"

// End of File
  最后helpexample.loc修改为:
Code:
/* Copyright (c) 2004, Nokia. All rights reserved */

CHARACTER_SET UTF8

#ifdef LANGUAGE_01
#include "helpexample.l01"
#endif

#ifdef LANGUAGE_31
#include "helpexample.l31"
#endif

// End of File
  同时%EPOCROOT%\Series60Ex\helpexample\src\中的helpexampleappui.cpphelpfulform.cpp处理帮助标志字串的方法也必须改为从资源文件中读取,
  %EPOCROOT%\Series60Ex \helpexample\src\helpexampleappui.cpp
Code:
/* Copyright (c) 2004, Nokia. All rights reserved */

// INCLUDE FILES
#include <e32std.h>
#include <hlplch.h>
#include <Helpexample.rsg>

#include "HelpExample.pan"
#include "HelpExampleAppUi.h"
#include "HelpExampleAppView.h"
#include "HelpExampleApplication.h"
#include "HelpExample.hrh"
#include "HelpfulForm.h"
//#include "HelpExample.hlp.hrh"


.
.
.

// -----------------------------------------------------------------------------
// CArrayFix <TCoeHelpContext>
// Return the help context for this application. 
// -----------------------------------------------------------------------------
//
CArrayFix <TCoeHelpContext>* CHelpExampleAppUi::HelpContextL() const
    {
    CArrayFixFlat <TCoeHelpContext>* array = 
                new ( ELeave )CArrayFixFlat <TCoeHelpContext> ( 1 );
    CleanupStack::PushL( array );
HBufC16* p = iEikonEnv->AllocReadResourceLC( R_KCA );
array->AppendL( TCoeHelpContext( KUidHelpExampleApp, (TBufC16<32>) *p ) );
CleanupStack::PopAndDestroy( p );
    CleanupStack::Pop( array );
    return array;
    }

// End of File
  %EPOCROOT%\Series60Ex \helpexample\src\helpfulform.cpp
Code:
/* Copyright (c) 2004, Nokia. All rights reserved */

// INCLUDE FILES
#include <AknAppUi.h>
#include <Avkon.rsg>
#include <eikmenup.h>
#include <Helpexample.rsg>

#include "HelpfulForm.h"
#include "HelpExampleApplication.h"
#include "HelpExample.hrh"
//#include "HelpExample.hlp.hrh"

.
.
.

// -----------------------------------------------------------------------------
// CHelpfulForm::GetHelpContext()
// Gets the control's help context. Returns a NULL context by default.
// -----------------------------------------------------------------------------
//
void CHelpfulForm::GetHelpContext( TCoeHelpContext& aContext ) const
    {
    // Get any special help context for the control with focus, else a default 
aContext.iMajor = KUidHelpExampleApp;

switch ( IdOfFocusControl() )
        {
        case EHelpExampleEdwin1:
// Provide special help context if first control has focus
{
    HBufC16* pce1 = iEikonEnv->AllocReadResourceLC( R_KCE1 );
            aContext.iContext = (TBufC16<32>) *pce1;
            }
            break;

        case EHelpExampleEdwin2:
// Provide special help context if second control has focus
{
    HBufC16* pce2 = iEikonEnv->AllocReadResourceLC( R_KCE2 );
            aContext.iContext = (TBufC16<32>) *pce2;
}
break;

        default:
// Provide default help context for this dialog otherwise
{
            HBufC16* pchf = iEikonEnv->AllocReadResourceLC( R_KCHF );
            aContext.iContext = (TBufC16<32>) *pchf;
            }
break;
        }
CleanupStack::PopAndDestroy( 1 );
    }

.
.
.

// End of File
  如果要制作安装包(.SIS),则%EPOCROOT%\Series60Ex\helpexample\sis\helpexample.pkg文件也必须作如下修改:
Code:
;/* Copyright (c) 2004, Nokia. All rights reserved */
; Installation file for HelpExample application
; HelpExample.pkg
;

;Language - standard language definitions
&EN

;Standard SIS file header
#{"HelpExample"},(0x10005B93),1,0,0

;Supports Series 60 v 2.0
(0x101F7960), 0, 0, 0, {"Series60ProductID"}

;
"..\..\..\epoc32\release\thumb\urel\HelpExample.APP"                        -"!:\system\apps\HelpExample\HelpExample.app"
"..\..\..\epoc32\data\z\system\apps\HelpExample\HelpExample.r01"            -"!:\system\apps\HelpExample\HelpExample.r01"
"..\..\..\epoc32\data\z\system\apps\HelpExample\HelpExample.r31"            -"!:\system\apps\HelpExample\HelpExample.r31"
"..\help\HelpExample.hlp"                                                   -"!:\system\help\helpexample.hlp"
"..\..\..\epoc32\data\z\system\apps\HelpExample\HelpExample_caption.r01"    -"!:\system\apps\HelpExample\HelpExample_caption.r01"
"..\..\..\epoc32\data\z\system\apps\HelpExample\HelpExample_caption.r31"    -"!:\system\apps\HelpExample\HelpExample_caption.r31"
"..\..\..\epoc32\data\z\system\apps\HelpExample\HelpExample.aif"         -"!:\system\apps\HelpExample\HelpExample.aif"
  至此,例程Help Example中文简体本地化的工作就完成了,修改后的例程在Series 602nd Edition Supporting Feature Pack 3 平台的模拟器和真机上均运行正常。其它版本SDK中的Help Example也可照此方法中文简体本地化,但也许会略有不同。

  谢谢各位!请开发伙伴们批评指正!
Reply With Quote

#3 Old Re: 上下文相关帮助本地化方案 - 2006-04-04, 19:22

Join Date: May 2004
Posts: 1,618
chenziteng's Avatar
chenziteng
Offline
Forum Nokia Champion
  S60平台本身支持上下文相关帮助的本地化,所以最简的步骤是:
1. 做好英文版的HLP文件
2. 拷贝RTF文件并翻译成其它语种(帮助标识不变),并生成HLP文件
3. 将帮助文件的后缀按其语种改为h01和h31等
4. 打包
Reply With Quote

#4 Old Re: 上下文相关帮助本地化方案 - 2006-04-05, 16:06

Join Date: Feb 2004
Posts: 1,928
r60600
Offline
Super Contributor
其实起初我的做法和你说的相同,但一直没能成功。
阁下可以具体讲讲吗?
在下愚钝,敬请赐教!
谢谢!
Reply With Quote

#5 Old Re: 上下文相关帮助本地化方案 - 2006-04-05, 17:59

Join Date: May 2004
Posts: 1,618
chenziteng's Avatar
chenziteng
Offline
Forum Nokia Champion
  步骤如前所述,就是常规的使用方法。

  我在"S60 2nd Edition SDK"的Emulator和真机(6600)上用过,可行。再往后在"S60 2nd Edition SDK FP3"的Emulator和真机(N90)上也用过,所以推测2.x上都能这么用。

  1.x的没试过,但我猜也行。
Reply With Quote

#6 Old Re: 上下文相关帮助本地化方案 - 2006-04-06, 13:37

Join Date: Oct 2005
Posts: 56
DZD_wangchao
Offline
Regular Contributor
Quote:
Originally Posted by chenziteng
  步骤如前所述,就是常规的使用方法。

  我在"S60 2nd Edition SDK"的Emulator和真机(6600)上用过,可行。再往后在"S60 2nd Edition SDK FP3"的Emulator和真机(N90)上也用过,所以推测2.x上都能这么用。

  1.x的没试过,但我猜也行。
按照你说的的做 编译的时候就通不过,没有反应,还望高手明细.
Reply With Quote

#7 Old Re: 上下文相关帮助本地化方案 - 2006-04-06, 14:49

Join Date: May 2004
Posts: 1,618
chenziteng's Avatar
chenziteng
Offline
Forum Nokia Champion
"A picture is worth a thousand words", so see the simple example.

"Qumjlxvo(LocalizedCSHelp).zip"
http://wiki.forum.nokia.com/index.ph...zedCSHelp).zip
Last edited by chenziteng : Yesterday at 17:51. Reason: fixed a broken link
Reply With Quote

#8 Old Re: 上下文相关帮助本地化方案 - 2006-04-08, 02:59

Join Date: Feb 2004
Posts: 1,928
r60600
Offline
Super Contributor
在chenziteng的提示下,发现本人原先的上下文相关帮助本地化方案是可行的。
下面以原始的Help Example为例进行上下文相关帮助的本地化。
首先,建立中文简体的帮助源文件,帮助标志不变,将%EPOCROOT%\Series60Ex \helpexample\help\下的helpexample.rtf另存为helpexample31.rtf,内容如下:
Code:

Author: Nokia
Date: 23 July 2002
Version: 1


HelpExample


0x10005B93


应用帮助

¢	ContextApplication The Application
i	帮助示例应用
当获得焦点的控制没有可用帮助时显示此信息。

帮助表格

¢	ContextHelpfulForm The form
i	帮助示例表格
这是一个执行上下文相关帮助的表格。当前两个控制获得焦点时会有相应的帮助。此信息在例外的情况下显示。

编辑框一

¢	ContextEdwin1 Control 1 on form
i	帮助示例编辑框一
这是表格中控制一的帮助。

编辑框二

¢	ContextEdwin2 Control 2 on form
i	帮助示例编辑框二
这是表格中控制二的帮助。
  将帮助项目文件helpexample.cshlp另存为helpexample31.cshlp,内容修改如下:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<?xml:stylesheet href="..\..\..\epoc32\tools\cshlpcmp\xsl\CSHproj.xsl" title="CS-Help project" type="text/xsl"?>
<!DOCTYPE cshproj SYSTEM "..\..\..\epoc32\tools\cshlpcmp\dtd\cshproj.dtd">

<cshproj>
  <helpfileUID>0x10005B94</helpfileUID>
  <directories>
    <input></input>
    <output></output>
    <graphics>pictures/</graphics>
    <working></working>
  </directories>
  <files>
    <source>
      <file>HelpExample31.rtf</file>
    </source>
    <destination>HelpExample.h31</destination>
	<customization>custom.xml</customization>
  </files>
</cshproj>
  可选的样式自定义文件custom.xml以及helpexample.rtfhelpexample.cshlp不变。
  接着修改%EPOCROOT%\Series60Ex\helpexample\group\下的supplementary.mk
Code:
makmake :
	cshlpcmp ..\help\HelpExample.cshlp
	cshlpcmp ..\help\HelpExample31.cshlp

ifeq (WINS, $(findstring WINS, $(PLATFORM)))
	copy ..\help\HelpExample.hlp ..\..\..\epoc32\$(PLATFORM)\c\system\help
	copy ..\help\HelpExample.h31 ..\..\..\epoc32\$(PLATFORM)\c\system\help
endif


clean :
	del ..\help\HelpExample.hlp
	del ..\help\HelpExample.hlp.hrh
	del ..\help\HelpExample.h31
	del ..\help\HelpExample.h31.hrh


bld :
	cshlpcmp ..\help\HelpExample.cshlp
	cshlpcmp ..\help\HelpExample31.cshlp

ifeq (WINS, $(findstring WINS, $(PLATFORM)))
	copy ..\help\HelpExample.hlp ..\..\..\epoc32\$(PLATFORM)\c\system\help
	copy ..\help\HelpExample.h31 ..\..\..\epoc32\$(PLATFORM)\c\system\help
endif

freeze lib cleanlib final resource savespace releasables :
  同样的%EPOCROOT%\Series60Ex \helpexample\Group\helpexample.mmp
Code:
/* Copyright (c) 2004, Nokia. All rights reserved */

TARGET          HelpExample.app
TARGETTYPE      app
UID             0x100039CE 0x10005B93
TARGETPATH      \system\apps\helpexample

.
.
.

SOURCEPATH      ..\help
DOCUMENT        HelpExample.rtf
DOCUMENT        HelpExample31.rtf
DOCUMENT        HelpExample.cshlp
DOCUMENT        HelpExample31.cshlp
DOCUMENT        Custom.xml

.
.
.

LIBRARY         euser.lib
LIBRARY         apparc.lib
LIBRARY         cone.lib 
LIBRARY         eikcore.lib  
LIBRARY         avkon.lib
LIBRARY         eikdlg.lib
LIBRARY         eikcoctl.lib
LIBRARY         hlplch.lib

LANG            01 31

AIF             HelpExample.aif ..\aif HelpExampleAif.rss c12 qgn_help_demo_cxt.bmp qgn_help_demo_cxt_mask.bmp qgn_help_demo_lst.bmp qgn_help_demo_lst_mask.bmp
  将同一目录的helpexample.loc另存为helpexample.l01,内容不变。
  再将helpexample.l01用UTF-8编码另存为helpexample.l31,写入简体中文字串:
Code:
/* Copyright (c) 2004, Nokia. All rights reserved */


// LOCALISATION STRINGS

// MENU TEXTS

//d:Command in options list.
//d:Show form.
#define qtn_help_helpexample_ShowForm "显示表格"

//d:Command in options list.
//d:Help.
#define qtn_help_helpexample_Help "帮助"

//d:Command in options list.
//d:Exit.
#define qtn_help_helpexample_Exit "退出"

// OPTIONS TEXTS IN VIEWING FORM

//d: Menu for "Options" when in viewing form
//d: Help
#define qtn_help_helpexample_ViewHelp "帮助"

//d:Caption string for app.
#define qtn_help_caption_string "帮助示例"

//d:Short caption string for app.
#define qtn_help_short_caption_string "帮助"

// d:Dialog Form.
// d: Names listed in Dialog.
#define qtn_help_dialog1_prompt "编辑框一"
#define qtn_help_dialog2_prompt "编辑框二"
#define qtn_help_dialog3_prompt "编辑框三"
// End of File
  最后helpexample.loc修改为:
Code:
/* Copyright (c) 2004, Nokia. All rights reserved */

CHARACTER_SET UTF8

#ifdef LANGUAGE_01
#include "helpexample.l01"
#endif

#ifdef LANGUAGE_31
#include "helpexample.l31"
#endif

// End of File
相应的%EPOCROOT%\Series60Ex\helpexample\sis\helpexample.pkg
Code:
;/* Copyright (c) 2004, Nokia. All rights reserved */
; Installation file for HelpExample application
; HelpExample.pkg
;

;Language - standard language definitions
&EN

;Standard SIS file header
#{"HelpExample"},(0x10005B93),1,0,0

;Supports Series 60 v 2.0
(0x101F7960), 0, 0, 0, {"Series60ProductID"}

;
"..\..\..\epoc32\release\thumb\urel\HelpExample.APP"                  -"!:\system\apps\HelpExample\HelpExample.app"
"..\..\..\epoc32\data\z\system\apps\HelpExample\HelpExample.r01"            -"!:\system\apps\HelpExample\HelpExample.r01"
"..\..\..\epoc32\data\z\system\apps\HelpExample\HelpExample.r31"            -"!:\system\apps\HelpExample\HelpExample.r31"
"..\help\HelpExample.hlp"                                                   -"!:\system\help\helpexample.hlp"
"..\help\HelpExample.h31"                                                   -"!:\system\help\helpexample.h31"
"..\..\..\epoc32\data\z\system\apps\HelpExample\HelpExample_caption.r01"    -"!:\system\apps\HelpExample\HelpExample_caption.r01"
"..\..\..\epoc32\data\z\system\apps\HelpExample\HelpExample_caption.r31"    -"!:\system\apps\HelpExample\HelpExample_caption.r31"
"..\..\..\epoc32\data\z\system\apps\HelpExample\HelpExample.aif"         -"!:\system\apps\HelpExample\HelpExample.aif"
其它文件保持原样,修改后的Help Example在Series 602nd Edition Supporting Feature Pack 3 平台运行正常。请各位开发伙伴帮忙测试一下其它平台的效果如何!

十分感谢chenziteng的帮助!
同时为一开始误导大家感到非常抱歉!
最后谢谢各位开发伙伴!
Last edited by r60600 : 2006-06-04 at 16:11.
Reply With Quote

#9 Old Re: 上下文相关帮助本地化方案 - 2006-08-19, 10:51

Join Date: Aug 2006
Posts: 14
Send a message via MSN to kevincao
kevincao's Avatar
kevincao
Offline
Registered User
本人初学者 有2个很小的问题 想请问
.pkg中的
; Language 不用设置么?

还有
.loc .l01 .l31这3个文件是如何来的?为什么叫 l01 l31呢?
为什么要有这两个01 31呢?
Reply With Quote

#10 Old Re: 上下文相关帮助本地化方案 - 2006-08-19, 11:50

Join Date: Mar 2005
Posts: 3,076
Send a message via Skype™ to hoolee
hoolee's Avatar
hoolee
Offline
Super Contributor
1、设置呀,如:
;Languages
&EN

2、.l01 .l31. loc都是自己命名的本地化资源文件,可以采用其他扩展名,这些都无所谓的,只要包含该文件时正确写对名称即可。


I'd just be the catcher in the rye
hoolee
Reply With Quote

#11 Old Re: 上下文相关帮助本地化方案 - 2006-08-21, 04:52

Join Date: Jul 2005
Posts: 1,686
cool_li's Avatar
cool_li
Offline
Forum Nokia Champion
这个是有规则的,例如 r31代表简体中文,r01代表英文.
Reply With Quote

#12 Old Re: 上下文相关帮助本地化方案 - 2006-08-21, 04:58

Join Date: Dec 2005
Posts: 442
amfat's Avatar
amfat
Offline
Regular Contributor
我的方法是直接做两个hlp文件后用同一个hrh就可以了,然后hlp文件用两个不同的UID,在l01和l31里便记录下UID,到时候读取的时候直接用UID读取就行了。
Reply With Quote

#13 Old Re: 上下文相关帮助本地化方案 - 2006-08-21, 05:12

Join Date: Aug 2006
Posts: 14
Send a message via MSN to kevincao
kevincao's Avatar
kevincao
Offline
Registered User
Quote:
正在执行预生成事件...
* Current build configuration: WINS UDEB
Compiling resources...
File C:\Symbian\8.0a\S60_2nd_FP2\Epoc32\release\wins\UDEB\z\system\apps\helpexample\helpexampleaif.r01 up-to-date, not rebuilt.
File C:\Symbian\8.0a\S60_2nd_FP2\Epoc32\release\wins\UDEB\z\system\apps\helpexample\helpexampleaif.r31 up-to-date, not rebuilt.
File C:\Symbian\8.0a\S60_2nd_FP2\Epoc32\release\wins\UDEB\z\system\apps\helpexample\HelpExample.r01 up-to-date, not rebuilt.
epocroot = \Symbian\8.0a\S60_2nd_FP2\
* C:\Symbian\8.0a\S60_2nd_FP2\\epoc32\gcc\bin\cpp.exe -undef -C -I C:\helpexample\inc -I C:\helpexample\help -I C:\helpexample\data -I C:\Symbian\8.0a\S60_2nd_FP2\\epoc32\include -I C:\Symbian\8.0a\S60_2nd_FP2\\Epoc32\include -DLANGUAGE_31 -D_UNICODE -D__SYMBIAN32__ -D__SERIES60_26__ -D__SERIES60_2X__ -D__SERIES60_2ND_FP2__ -D__SERIES60_2FP2__ -D__WINS__ -D__VC32__ C:\helpexample\data\HelpExample.rss -o C:\helpexample\data\HelpExample.rss.I
epocroot = \Symbian\8.0a\S60_2nd_FP2\
* C:\Symbian\8.0a\S60_2nd_FP2\\epoc32\tools\rcomp.exe -u -oC:\Symbian\8.0a\S60_2nd_FP2\Epoc32\release\wins\UDEB\z\system\apps\helpexample\HelpExample.r31 -hC:\helpexample\inc\HelpExample.rsg.new -sC:\helpexample\data\HelpExample.rss.I -iC:\helpexample\data\HelpExample.rss
C:\\helpexample\\data\\helpexample.l31(1) : *** Unknown character '? (value 0xffffffef)
C:\\helpexample\\data\\helpexample.l31(1) : *** Unknown character '? (value 0xffffffbb)
C:\\helpexample\\data\\helpexample.l31(1) : *** Unknown character '? (value 0xffffffbf)
RCOMP failed with code 1
ERROR: RCMake failed: (Resources): rcomp.exe failed with code 1. (Reason: Incorrect function.)
Project : error PRJ0019: 工具从"正在执行预生成事件..."
我用记事本把l01存成l31的时候改成UTF8了 为什么还这样啊 请不惜赐教 谢谢
Reply With Quote

#14 Old Re: 上下文相关帮助本地化方案 - 2006-08-21, 07:47

Join Date: Jul 2005
Posts: 1,686
cool_li's Avatar
cool_li
Offline
Forum Nokia Champion
查看prel的版本,要5.6xxx的那个版本.
5.8的不行.
Reply With Quote

#15 Old Re: 上下文相关帮助本地化方案 - 2006-08-22, 04:33

Join Date: Aug 2006
Posts: 14
Send a message via MSN to kevincao
kevincao's Avatar
kevincao
Offline
Registered User
perl 已经改了 英文的可以生成 阿
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2010 Nokia