Serge
view release on metacpan or search on metacpan
doc/sample.serge view on Meta::CPAN
%NAME:LNAME% - split the %NAME% using the leftmost dot and take the left part
%NAME:LEXT% - split the %NAME% using the leftmost dot and take the right part
(%NAME% is equivalent to %NAME:NAME%.%NAME:EXT%)
%LNAME:NOLOCALE% - take %LNAME% and strip the source locale '_XX' suffix
(e.g. '_en')
%NAME:NOLOCALE% - take %NAME% and strip the source locale '_XX' suffix
(e.g. '_en')
%FILE% - original file name including full path
(equivalent to %PATH%%NAME%.%EXT% or %PATH%%LNAME%.%LEXT%)
%LANG% - language tag (e.g. 'en', 'ru', 'pt-br')
%CULTURE% - culture tag (e.g. 'en-US', 'ru-RU', 'pt-BR')
%LOCALE% - locale name (e.g. 'en', 'ru', 'pt_BR')
%LOCALE:ANDROID% - locale name as used on Android (e.g. 'en', 'ru', 'pt-rBR')
%LOCALE:IPHONE% - locale name as used on iPhone
(**DEPRECATED**, use %LANG% instead + `output_lang_rewrite`)
%LOCALE:LC% - a lowercased locale name (e.g. 'en', 'ru', 'pt_br')
%LOCALE:UC% - an uppercased locale name (e.g. 'EN', 'RU', 'PT_BR')
%LOCALE:FULL% - full locale with country name (e.g. 'en_US', 'ru_RU', 'pt_BR')
%LOCALE:FULL:LC% - same as above, but lowercased
%LOCALE:FULL:UC% - same as above, but uppercased
%LANGNAME% - full language name (e.g. 'English', 'Russian') used in Mac
(**LEGACY, DEPRECATED**)
%LANGNAME:IPHONE%- full language name (e.g. 'English', 'Russian') used in iPhone
(**LEGACY, DEPRECATED**)
%LANGID% - Win32 laguage locale as 4-digit hex value (e.g. '0419')
%LANGID:DEC% - Win32 laguage locale as decimal value (e.g. '1049')
%LANGCONST% - Win32 LANG_ constant (e.g. 'LANG_RUSSIAN')
%SUBLANGCONST% - Win32 SUBLANG_ constant (e.g 'SUBLANG_RUSSIAN_RUSSIA')
%AFXTARGCONST% - Win32 AFX_TARG_ constant (e.g. 'AFX_TARG_RUS')
%CODEPAGE% - Win32 codepage (e.g. '1251')
*/
# (BOOLEAN) [OPTIONAL] Should the language-specific files be created
# from each target language (see `destination_languages` parameter)?
# YES - localized files should be created (default)
# NO - localized files should not be created (useful when one doesn't want to have
# the localized files but rather use some plugin to export the translations in some
# separate format)
output_lang_files YES
# (BOOLEAN) [OPTIONAL] Should the localized files be created
# for the default language (see `source_language` parameter) as well?
# YES - the files needs to be created
# NO - do not create the files (default)
# Note: This option is handy when the source file is not the final localizable
# resource to use but rather a template that has to be preprocessed.
# See e.g. the `parse_master` parser and its `.master` template file format
# that allows one to mark up unstructured plain text files for translation
output_default_lang_file NO
# (STRING) [OPTIONAL] Output encoding for generated language files
# Sample values: UTF-8, UTF-16, UCS-2, UCS-4
# Default: UTF-8
# This value has effect only if `output_lang_files` or `output_default_lang_file`
# parameters are set to YES
output_encoding UCS-2LE
# (BOOLEAN) [OPTIONAL] Should the BOM ("byte order mark")
# be emitted at the beginning of the output file?
# YES - output the BOM (default)
# NO - do not output the BOM
output_bom YES
# [OPTIONAL] Map telling to use different language name in language macros
# (see the list of available macros in `ts_file_path` parameter description)
# and when constructing output path (see `output_file_path` parameter).
# This allows to tweak language/locale names for different projects.
output_lang_rewrite
{
no nb
}
# (STRING) Path to a generated file (relative to the config file or absolute).
# Allowed macros: same as for the `ts_file_path` parameter (see above)
# This value has effect only if `output_lang_files` or `output_default_lang_file`
# parameters are set to YES
output_file_path ./%FILE%.%LANG%
# [OPTIONAL] A list of callback plugins that we should load,
# with the parameters to pass
callback_plugins
{
# First plugin definition
{
# (STRING) Plugin to use for processing.
# See Serge/Engine/Plugin/*.pm files
plugin foo_plugin
# [OPTIONAL] Data for plugin parameters. Each plugin may have
# specific parameters inside the `data` block. See the documentation
# for each specific plugin for more information.
data
{
bar YES
baz string
etc 1 2 3
}
}
}
} # end of first job definition
# Second job definition
{
id sample.job
name Sample `<%`...`%>` parsing job
source_language en
destination_languages es de it fr ru
source_dir ./sample
source_match \.txt\.master$
parser
{
plugin parse_master
}
db_source DBD:SQLite:dbname=./translate.db3
db_namespace sample
ts_file_path ./po/sample/%LANG%/%FILE%.po
output_file_path ./sample/%FILE%.%LANG%
} # end of second job definition
( run in 0.398 second using v1.01-cache-2.11-cpan-d7f47b0818f )