World Wide Navi Help
Externalize Strings

Analyze source codes and externalize embedded strings to resource files automatically.
This operation is available in [I18N] -> [Externalize Strings], [Externalize Strings Icon In Toolbar],
[Right Click In Source Directory] -> [I18N] -> [Externalize Strings], or
[Right Click On Editors] -> [I18N] -> [Externalize Strings].

YouTube Demo
MP4 Demo

The basic process of this function is following.
[Analyze Sources] -> [Detect String Literals] -> [Modify Sources & Append Resources] -> [Analyze Again]

About the same items as analysis, refer to Source Code Analysis.

Externalization has several types for each programming language and styles (e.g. Windows MFC + satellite dll, Linux Gunome + gettext .etc.) and you need to choose the appropriate type for your application.
You can switch externalization types in Preferences dialog, and should comfirm the settings before externalization, or incorrect type setting may break your source codes.(*1)

About the preferences, refer to the Preferences described later.

*1) When the libraries get changed, the appropriate type will be set automatically (e.g. if you select 'MFC', type will be set 'Windows DLL'), but just in case, to check the preferences every time before execution is recommended. Especially, if you use Windows Win32/MFC applications, you should be careful about preferences. Please refer to MFC/Win32 Preferences.

[Location]
Set the target lines to externalize.
 [All lines]
 Externalize the strings in all lines.
 (*CAUTION: If you are using Free version, only one line can be externalized by each execution.)
 [Selected line]
 Externalize the stirngs in the current line only.

[Insert comments in modified location]
If checked, comments with original source code line, the specified header and timestamp get inserted to the modified source codes.
You can track the modified points later, or recover original source code with these comments.

[Create backup files]
If checked, the backup files of the modified files will be created.
The modified source codes can be restored with these files by Source Code Restorement.
One source file can keep one backup file only which was created at the first execution.

[Preferences]
Open the preferences dialog of the selected source type.

Preferences

C/C++ has 4 types of externalization, VB has 2 types, others has only one type.
In some of preferences, you can use World Wide Navi
Pattern Expression described later.


C/C++ Preferences

=== gettext ===
Use GNU gettext programming for Linux applications.

[Addtional Header Files]
You can add your own header files in each source files.
Necessary header files get included automatically.

[Process In 'main' Fucntion]
Set process in the entry point 'main' (e.g. locale setting).

 [Locale setting pattern expression]
 Describe locale setting process with
Pattern Expression.
 Default: setlocale (LC_ALL, "")

 [Domain binding pattern expression]
 Describe domain binding process with Pattern Expression.
 Default: bindtextdomain("$DOMAIN-NAME", ".")

 [Domain setting pattern expression]
 Describe domain setting process with Pattern Expression.
 Default: textdomain("$DOMAIN-NAME")

[PO File]
Set gettext resource file (.pot file) configuration.

 [Specify the location]
 If checked, resource file gets created in the specified directory.
 Default: Unchecked, location is the same as application.

 [Use source name as domain name]
 If selected, resource file gets created with the name of the source directory or file.
 This name gets set to $DOMAIN-NAME.

 [Specify the domain name]
 If selected, resource file gets created with the specified name.
 This name gets set to $DOMAIN-NAME.

 [Create a compile script]
 If checked, shell script to compile the resource file to binary (.mo) get created.
 Default: Checked.


=== catgets ===
Use message catalog with catgets for legacy Unix applications.

[Addtional Header Files]
You can add your own header files in each source files.
Necessary header files get included automatically.

[Process In 'main' Fucntion]
Set process in the entry point 'main' (e.g. locale setting).

 [Locale setting pattern expression]
 Describe locale setting process with
Pattern Expression.
 Default: setlocale (LC_ALL, "")

 [Message catalog opening pattern expression]
 Describe message catalog opening process with Pattern Expression.
 Default: catopen ("$CAT-NAME.cat", NL_CAT_LOCALE)

[Message Catalog File]
Set message catalog resource file (.msg file) configuration.

 [Specify the location]
 If checked, resource file gets created in the specified directory.
 Default: Unchecked, location is the same as application.

 [Use source name for catalog name]
 If selected, resource file gets created with the name of the source directory or file.
 This name gets set to $CAT-NAME.

 [Specify the catalog name]
 If selected, resource file gets created with the specified name.
 This name gets set to $CAT-NAME.

 [Create a compile script]
 If checked, shell script to compile the resource file to binary (.cat) get created.
 Default: Checked.

[Message Catalog Variable Name]
Set variable name of the opened catalog in source codes.


=== Windows DLL ===
Use dynamic dll loading (satellite dll) for Windows applications without .NET.

[Addtional Header Files]
You can add your own header files in each source files.
Necessary header files get included automatically.

[Resource DLL]
Set process of dll loading and string loading from it. (LoadLibrary and LoadString).

 [DLL loading pattern expression]
 Describe loading function of dll with
Pattern Expression.
 Default: wwnaviLoadLibrary() (auto-generated function by wwnavi)
 For Visual Studio Win32 aplication,
 click 'Set Win32 Handle' and set this to 'hInstance = wwnaviLoadLibrary()'.
 For Visual Studio MFC aplication,
 click 'Set MFC Handle' and set this to 'AfxSetResourceHandle(wwnaviLoadLibrary())'.
 For more information, refer to MFC/Win32 Preferences.

 [String loading pattern expression]
 Describe loading function of strings from the dll handle with Pattern Expression.
 Default: wwnaviGetString($WIN-RC-KEY) (auto-generated function by wwnavi)
 If you want to treat strings as 'String' class,
 click 'Use String Class' and set this to 'gcnew String(wwnaviGetString($WIN-RC-KEY))'.
 For more information, refer to MFC/Win32 Preferences.

[RC File]
Set Windows resource file (.rc file) configuration.

 [Specify the location]
 If checked, resource file gets created in the specified directory.
 Default: Unchecked, location is the same as application.

 [Name]
 Specify the RC file name without extension.
 This name + your project name = resource dll (project) name.

 [Encoding]
 Specify the RC file encoding. This can be set by language selecting.
 This needs fit to target string encoding.
 e.g.) For Japanese string externalization, use 'MS932'.

 Default: the current language encoding.

 [Resource key prefix]
 Prefix of reousrce key in RC files.
 This name + auto-sequence number = resource key. (set to $WIN-RC-KEY)

 [Create a Visual Studio project]
 If checked, create a dll project for compiling this RC file to dll.
 The dll name is corresponding to auto-generated codes by wwnavi, so strongly recommended to check.

 [Version]
 Specify the Visual Studio version of the dll project described above.
 The latest wwnavi can detect existing project version, so you don't need to care about this item.

 [Include Visual Studio resources]
 If checked, the RC file includes Visual Studio MFC/Win32 RC file,
 which has same name as the project and contains GUI menu, widget captions, and others.
 If this unchecked, the reousrce dll will contain only externalized strings,
 not the menu and other resources.
 Moreover, if this checked, DLL loading pattern expression needs set
 either 'hInstance = ..' or 'AfxSetResourceHandle(...', depending on if you use a Win32 or MFC project.

 For more information, refer to MFC/Win32 Preferences.


=== .NET ===
Use .NET ResourceManager for Windows .NET applications.

[Addtional Header Files]
You can add your own header files in each source files.
Necessary header files get included automatically.

[Resource Manager]
Set process of creating ResourceManager class and getting strings from it.

 [Resource namager creating pattern expression]
 Describe the function of newing ResourceManager with
Pattern Expression.
 Default: Wwnavi::Resource::Init() (auto-generated function by wwnavi)

 [String loading pattern expression]
 Describe the function of loading strings from ResourceManager with Pattern Expression.
 Default: Wwnavi::Resource::GetString("$DOTNET-RESX-KEY") (auto-generated function by wwnavi)

[Resx File]
Set .NET resource file (.resx file) configuration.

 [Specify the location]
 If checked, resource file gets created in the specified directory.
 Default: Unchecked, location is the same as application.

 [Name]
 Specify the Resx file name without extension.
 This name needs to be a part of ReourceManager name.

 [Resource key prefix]
 Prefix of reousrce key in Resx files.
 This name + auto-sequence number = resource key. (set to $DOTNET-RESX-KEY)


MFC/Win32 Preferences
The mapping of application type (MFC/Win32) and preferences are described below.

Application Type Externalizaiton Type DLL loading String loading Include Visual Studio resources
MFC Window Application Windows DLL AfxSetResourceHandle(***)
(set handle returned by LoadLibrary)
wwnaviGetString($WIN-RC-KEY)
(return TCHAR* by LoadString)
Checked
(pack generated string .rc and GUI .rc into one dll)
Win32 Window Application Windows DLL hInstance = ***
(set handle returned by LoadLibrary)
wwnaviGetString($WIN-RC-KEY)
(return TCHAR* by LoadString)
Checked
(pack generated string .rc and GUI .rc into one dll)
MFC/Win32 String Using Application Windows DLL Depends on your project gcnew String(wwnaviGetString($WIN-RC-KEY))
(return String generated from TCHAR* by LoadString)
Depends on your project
Other MFC/Win32 Application Windows DLL If you use a project with some handle in main, set the loaded dll to it, otherwise just load dll only. wwnaviGetString($WIN-RC-KEY)
(return TCHAR* by LoadString)
If you have the default .rc file, set it to the generated .rc.


Java Preferences

[Resource Bundle]
Set process of creating resource managing class and getting strings from it.

 [Provider class name]
 Describe the class to create resource managing class instances.
 This class returns static instances in each class.
 Default: java.util.ResourceBundle (Standard J2SE class)

 [Provider method pattern expression]
 Describe the method of creating resource managing class instances with
Pattern Expression.
 This needs to be a member method of the provider class described above.
 Default: getBundle("$BASE-NAME") (Standard J2SE method, ResourceBundle.getBundle)

 [Instance class name]
 Describe the resource managing class.
 Instances of this class get created static in each class by the provider class described above.
 Default: java.util.ResourceBundle (Standard J2SE class)

 [Instance method pattern expression]
 Describe the method of getting strings from resources with Pattern Expression.
 This needs to be a member method of the instance class described above.
 Default: getString("$RESOURCE-KEY") (Standard J2SE method, ResourceBundle.getString)

[Properties File]
Set Java resource file (.properties file) configuration.

 [Specify the location]
 If checked, resource file gets created in the specified directory.
 Default: Unchecked, location is the top directory of Java package.

 [Use class name for base name]
 If selected, resource file gets created with the name of each class.
 This name gets set to $BASE-NAME.

 [Specify the base name]
 If selected, resource file gets created with the specified name.
 This name gets set to $BASE-NAME.

 [Specify the language]
 If checked, the specified language code get inserted to resource file name.
 Country code also can be inserted.
 Default: resource file has no language and country codes.

 [Create UTF-8 text]
 If checked, non-ASCII strings (original hardcoded strings in source codes)
 get output to a another UTF-8 text file than the resource file.
 You can check the orinal strings with this text, even if they are non-ASCII characters (e.g. Japanese).

[Resource Bundle Variable Name]
Specify the variable name of resource managing class instances.

[Resource Key Prefix]
Specify the prefex of reource keys in the resource file.
 This name + auto-sequence number = resource key. (set to $RESOURCE-KEY)


C# Preferences

[Resource Manager]
Set process of creating ResourceManager class and getting strings from it.

 [Resource namager creating pattern expression]
 Describe the function of newing ResourceManager with
Pattern Expression.
 Default: Wwnavi.Resource.Init() (auto-generated function by wwnavi)

 [String loading pattern expression]
 Describe the function of loading strings from ResourceManager with Pattern Expression.
 Default: Wwnavi.Resource.GetString("$DOTNET-RESX-KEY_CS") (auto-generated function by wwnavi)

 [Modify source codes of form designers]
 If checked, externalize strings in auto-generated code by Visual Studio.
 Default: Unchecked.

[Resx File]
Set .NET resource file (.resx file) configuration.

 [Specify the location]
 If checked, resource file gets created in the specified directory.
 Default: Unchecked, location is the same as application.

 [Name]
 Specify the Resx file name without extension.
 This name needs to be a part of ReourceManager name.

 [Resource key prefix]
 Prefix of reousrce key in Resx files.
 This name + auto-sequence number = resource key. (set to $DOTNET-RESX-KEY_CS)

 [Add file name to prefix]
 If checked, resource keys includes each source file name at the beginning.


VB Preferences

=== Windows DLL ===
Use Windows API programming for Visual Basic 6.0 applications.

[Resource DLL]
Set process of loading strings from resource dlls.

 [String loading pattern expression]
 Describe loading function of strings from the dll handle with
Pattern Expression.
 Default: wwnaviGetString($WIN-RC-KEY_VB) (auto-generated function by wwnavi)

[RC File]
Set Windows resource file (.rc file) configuration.

 [Name]
 Specify the RC file name without extension.
 This name + your project name = resource dll (project) name.

 [Encoding]
 Specify the RC file encoding. This can be set by language selecting.
 This needs fit to target string encoding.
 e.g.) For Japanese string externalization, use 'MS932'.

 Default: the current language encoding.

 [Starting number of resource keys]
 Set the initial value of resource keys in resource files.
 auto-sequence number starting from this number = resource key. (set to $WIN-RC-KEY_VB)

 [Bin directory of resource compiler (rc.exe)]
 Script to compile the RC file to .res file get created after externalization,
 including absolute path of rc.exe under this bin directory.


=== .NET ===
Use .NET ResourceManager for Windows .NET applications.

[Resource Manager]
Set process of creating ResourceManager class and getting strings from it.

 [String loading pattern expression]
 Describe the function of loading strings from ResourceManager with
Pattern Expression.
 Default: Wwnavi.Resource.GetString("$DOTNET-RESX-KEY_VB") (auto-generated function by wwnavi)

[Resx File]
Set .NET resource file (.resx file) configuration.

 [Specify the location]
 If checked, resource file gets created in the specified directory.
 Default: Unchecked, location is the same as application.

 [Name]
 Specify the Resx file name without extension.
 This name needs to be a part of ReourceManager name.

 [Resource key prefix]
 Prefix of reousrce key in Resx files.
 This name + auto-sequence number = resource key. (set to $DOTNET-RESX-KEY_VB)


JSP Preferences

[Resource Bundle]
Set process of creating resource managing class and getting strings from it.

 [Provider class name]
 Describe the class to create resource managing class instances.
 This class returns static instances in each class.
 Default: java.util.ResourceBundle (Standard J2SE class)

 [Provider method pattern expression]
 Describe the method of creating resource managing class instances with
Pattern Expression.
 This needs to be a member method of the provider class described above.
 Default: getBundle("$BASE-NAME") (Standard J2SE method, ResourceBundle.getBundle)

 [Instance class name]
 Describe the resource managing class.
 Instances of this class get created static in each class by the provider class described above.
 Default: java.util.ResourceBundle (Standard J2SE class)

 [Instance method pattern expression]
 Describe the method of getting strings from resources with Pattern Expression.
 This needs to be a member method of the instance class described above.
 Default: getString("$RESOURCE-KEY") (Standard J2SE method, ResourceBundle.getString)

[Properties File]
Set Java resource file (.properties file) configuration.

 [Specify the location]
 If checked, resource file gets created in the specified directory.
 Default: Unchecked, location is the directory, 'WEB-INF/classes'.

 [Use JSP name for base name]
 If selected, resource file gets created with the name of each JSP.
 This name gets set to $BASE-NAME.

 [Specify the base name]
 If selected, resource file gets created with the specified name.
 This name gets set to $BASE-NAME.

 [Specify the language]
 If checked, the specified language code gets inserted to the resource file name.
 Country code also can be inserted.
 Default: resource file has no language and country codes.
 *CAUTION: if you use the different language from the server OS as default
 (e.g. your application is running at Japanese server, but you uses the
 English resource as default), you need specify that language.


 [Create UTF-8 text]
 If checked, non-ASCII strings (original hardcoded strings in source codes)
 get output to a another UTF-8 text file than the resource file.
 You can check the orinal strings with this text, even if they are non-ASCII characters (e.g. Japanese).

[Resource Bundle Variable Name]
Specify the variable name of resource managing class instances.

[Resource Key Prefix]
Specify the prefex of reource keys in the resource file.
 This name + auto-sequence number = resource key. (set to $RESOURCE-KEY)


ASP Preferences

 [Use 'meta:resourcekey' (for asp label only)]
 If checked, Adding 'meta:resourcekey=' in each ASP tags instead of replaceing Text="**".
 *CAUTION: This option externalizes asp labels only, and DO NOT use unchecked (normal) and checked (meta) at the same project.

[Resx File]
Set .NET resource file (.resx file) configuration.

 [Resource key prefix]
 Prefix of reousrce key in Resx files.
 This name + auto-sequence number = resource key.

 [Add file name to prefix]
 If checked, resource keys includes each source file name at the beginning.


PHP Preferences

[Use gettext]
Externalize strings using gettext process.

[Resource Handling]
Set process of loading resource files.

 [Initializing Code]
 Specify the code initially called from 'require_once(...wwnavi*.php)'.
 By default, retrieving user locale, setlocale calling, and resource binding process.
 for more details, refer to
Internationalization By gettext.

 [String Load Function]
 Specify the loading function of strings from resource files.
 This will replace the embedded strings and need to return strings too.
 Default: _("$EX-STRING") (gettext function)

[Resource File]
Set resoure file (gettext .pot) configuration.

 [Specify the top directory]
 If checked, resource file will be created in Resource Path under the specified directory.
 Default: Unchecked, location is the directory containing TOP files like 'index.*'.

 [Resource Path]
 Specify the path (directory) to resource files from Top Directory.
 Default: wwnaviRs

 [Resource Name]
 Specify resource file name without extension.
 Default: wwnaviBundle

 [Specify the language]
 If checked, the specified language code get inserted to the resource path (LOCALE(e.g. 'en_US')/'LC_MESSAGES').
 Country code also can be inserted.
 Default: resource file has no language and country codes.

[Run xgettext after externalization]
If checked, run xgettext commad to all source files to update the pot files from existing _("").
If you changed some strings (gettext id as $EX-STRING above) already externalized, you need run this command.
Default: Checked.


JavaScript Preferences

[Use JSON/Properties]
Switching resource format to JSON or Java Properties file.
The resource handling process changes according to them.

[Resource Handling]
Set process of loading resource files.

 [Load JS files dynamically]
 If checked, JS file loading code in Ajax style will be inserted to initializing code.
 By default, jquery.min.js and jquery.i18n.properties.js are required for using Properties.
 No external scripts are necessary for using JSON.
 If these files are already included by SCRIPT tags in original HTMLs, uncheck this.
 (If unchecked, these files need to be included manually.)
 Default: Checked

 [Additional JS Files]
 If you want to load other JS files than above, specify the URL( or relative path)s of them
 splitted by new lines.
 If Load JS files dynamically is unchecked, these files never be loaded.
 Default: blank (even if it's blank, the two files above are always loaded in using Properties.)

 [Initializing Code]
 Specify the code initially called after loading necessary JS files, ahead of other loading.
 By default, process of Ajax function, loading resource, and detecting user locale are written.
 for more details, refer to
Internationalization By JSON and Internationalization By jQuery.

 [String Load Function]
 Specify the loading function of strings from resource files.
 This will replace the embedded strings and need to return strings too.
 Default: wwnRs.$RESOURCE-KEY for using JSON, jQuery.i18n.prop("$RESOURCE-KEY") for using Properties.

[Resource File]
Set resoure file (JSON or Java Properties) configuration.

 [Specify the top directory]
 If checked, resource file will be created in Resource Path under the specified directory.
 Default: Unchecked, location is the directory containing TOP files like 'index.*'.

 [Resource Path]
 Specify the path (directory) to resource files from Top Directory.
 Default: wwnaviRs

 [Resource Name]
 Specify resource file name without extension.
 Default: wwnaviBundle

 [Specify the language]
 If checked, the specified language code gets inserted to the resource file name or its parent directory (depending on whether you use JSON or Properties).
 Country code also can be inserted.
 Default: resource file has no language and country codes.

 [Create UTF-8 text]
 If checked, non-ASCII strings (original hardcoded strings in source codes)
 get output to a another UTF-8 text file than the resource file.
 You can check the orinal strings with this text, even if they are non-ASCII characters (e.g. Japanese).
 (*This is valid for using Properties only.)

[Resource Key Prefix]
Specify the prefex of reource keys in the resource file.
 This name + auto-sequence number = resource key. (set to $RESOURCE-KEY)


ActionScript Preferences

[Resource Bundle]
Set process of loading resource-bundles.

 [String Load Function]
 Specify the loading function of strings from resource-bundles.
 This will replace the embedded strings and need to return strings too.
 Default: WwnaviRs.getString("$RESOURCE-KEY") (Load function of wwnavi generated class)

[Properties File]
Set resource file (.properties file) configuration.

 [Specify the location]
 If checked, resource file will be created under the specified directory.
 Default: Unchecked, location is the directory 'locale', in the same level as the parant directory of source files.

 [Base Name]
 Specify resource files' name (base name).
 Default: wwnaviRs

 [Specify the language]
 If checked, the specified language code gets inserted to the resource file name.
 Country code also can be inserted.
 Default: resource file has no language and country codes.

[Resource Key Prefix]
Specify the prefex of reource keys in the resource file.
 This name + auto-sequence number = resource key. (set to $RESOURCE-KEY)


Pattern Expression

String Externalization preferences is enabled by some Pattern Expressions (not regular expression) to indicate resource files names, reousrce key values, and others.
For details, click the link '>>About pattern expression' in each preference dialog.


Restrictions

String externalization of web script languages (JSP .etc.) skips some HTML tag texts and scriptlets.
In this case, you need externalize them manually after one-time externalization.

























Go to Index


Copyright (C) 2012 Kokusaika JP, Inc.
All rights reserved. No reproduction or republication without written permission.