Special Translation Processes:
Special translation processes are performed during the translation of contents from a source language into a target language using one of the translation services configured in the KMFasTrans options.
Frequently there are some sequences of characters in the source text of the translation that are not intended to be translated directly into the target language because they represent a content with special meaning. This is the case of strings that are analyzed by plugins that act according to the content found, such as the string {loadmoduleid xx} to insert the module whose id is xx. If 'loadmoduleid' were translated into another language, the plugin would not recognize the string and therefore would not insert the module.
Following with this example, the value xx will probably be different for the different languages, so in this case it is not only necessary to keep the string 'lodmodule' untranslated, but also to change the value xx to the id of the module that is the translation of the module with id xx. Naturally this requires that there is a translation, known by KMFasTrans, of the module whose id is xx to the target language. This will always be true if the module whose id is xx has been translated with KMFasTrans before translating the article containing the string.
To achieve this functionality, these special translation processes have been designed. Each process is represented by a rule to which some parameters are supplied. Each rule can use a subset of the total. The subset of parameters used by a rule is displayed when selecting the rule in the 'Rule' drop-down.
To identify the process to be performed, both the rule and its parameters must be enclosed between tags. The tags to which the process is applied are selected in the 'Applies to' parameter. The tags themselves are configured in the 'Translations Tags' screen.
Access to the list screen of the special translation processes is done through the 'Special Translation Processes' link from any of the KMFasTrans screens. By clicking on this link you get this screen:
The columns represent the fields of each special process. Some fields are applicable and others are not applicable depending on the chosen rule. In the list above, empty columns indicate fields that are not applicable.
Rules 3, 3A and 3B require to supply a text for each language. The editing screen for these rules (a Rule 3B in this example) is as folllow:
General tab:
Replacements by language tab:
The following describes the currently available rules and their parameters.
Rule 1. Preserving the content
Rule 1 performs a process that consists in preserving, without translation, all the characters contained between the opening tag and the closing tag for any pair of configured tags in the 'Aplies to' parameter.
Example:
Rule 1 is the default rule. It will apply whenever no other applicable rule is found for the string under treatment. The other rules have preference over Rule 1. It is advisable to have Rule 1 enabled for tags that may have non-translatable content, such as loadposition xxx.
Rule 2. Partial translation.
The string set in the 'Trigger' parameter will be preserved without translation and the rest of the content between the tags to which this rule applies will be translated into the target language.
Example:
Parameters set on the General tab: (The trigger can not contain spaces)
- Trigger: tab=
- Applies to: 'Default curly brackets' . We are assumning that 'Default curly brackets' is configured as a pair of tags and the tags are { and }
Process performed: Whenever the string is found in the source text, this string will be replaced by the string
in the text translated into the target language, where yyy yyy is the translation of xxx xxx into the target language.
If the text is omitted, the result is the same as that of Rule 1 only for the trigger, that is, the trigger will be retained in the target language text. This can be useful if you do not want to apply Rule 1, which preserves any text between tags but you want to preserve only a particular text between tags (the trigger).
Rule 3. Replace content between tags in the source text with specific content for each target language.
The replacement affects all content between the configured pair of tags for this process.
Example:
Parameters set on the General tab:
- Applies to: 'Gallery' . We are assumming that Gallery is configured as a pair of tags and the tags are
and
Parameters set on the Replacements by Language tab:
- English: ft/doc/SomeScreenshots/en
- Spanish: ft/doc/SomeScreenshots/es
Process performed: If the source language is English, whenever the string ft/doc/SomeScreenshots/en
is found in the English text, this string will be replaced in the text translated into Spanish by the string
ft/doc/SomeScreenshots/es
.
Warning: If you configure this rule for the same tags as Rule 1, as this one takes precedence over Rule 1, Rule 1 will never apply and whenever any content between these tags is found, this rule will apply. Normally you will have set Rule 1 for tags { } and Rule 3 for other more specific tags.
Rule 3A. Replace content between tags (except Trigger parameter) in the source language with specific content for each target language, when the trigger is found.
The replacement affects all content between the opening and closing tags except the content of the 'Trigger' parameter. The process will only take place when the text entered in the 'Trigger' parameter is found.
Example:
Parameters set on the General tab: (The trigger can not contain spaces)
- Trigger: trigger1
- Applies to: 'Default curly brackets' . We are assumning that 'Default curly brackets' is configured as a pair of tags and the tags are { and }
Parameters set on the Replacements by Language tab:
- English: some_dir/some_english_file.php
- Spanish: some_dir/some_spanish_file.php
Process performed:
Let's assume that:
- The source language is English
- The target language is Spanish
Then: whenever the string is found in the English text, this string will be replaced by the string
in the text translated into Spanish language.
Rule 3B. Replace content between delimiters inside tags in the source language with specific content for each target language, when the trigger is found.
The replacement affects all content between the opening delimiter and the closing delimiter between tags. The process will only take place when the text entered in the 'Trigger' parameter is found.
Example:
Parameters set on the General tab: (The trigger can not contain spaces)
- Trigger: jumi
- Applies to: 'Default curly brackets' . We are assumning that 'Default curly brackets' is configured as a pair of tags and the tags are { and }
- Opening delimiter: [
- Closing delimiter: ]
Parameters set on the Replacements by Language tab:
- English: some_dir/some_english_file.php
- Spanish: some_dir/some_spanish_file.php
Process performed:
Let's assume that:
- 'trigger' be jumi
- The source language is English
- The target language is Spanish
Then: whenever the string is found in the English text, this string will be replaced by the string
in the text translated into Spanish language.
Rule 4. Replace an id between tags in the text of the source language with the id translation into the target language.
In this rule the Trigger is mandatory. The id is in the string between the configured tags except the trigger.
For this process to work properly, there must be a translation, known to KMFasTrans, of the module whose id is xx, to the target language. This will always be true if the module whose id is xx has been translated using KMFasTrans before translating the article containing the string. If the translation of the module whose id is xx is not found, the same existing xx in the source language will be preserved in the target language.
Example:
Parameters set on the General tab: (The trigger can not contain spaces)
- Trigger: loadmoduleid
- Applies to: 'Default curly brackets' . We are assumning that 'Default curly brackets' is configured as a pair of tags and the tags are { and }
- Component: Modules
Process performed:
Let's assume that:
- The source language is English and the target language is Spanish
- 'xx' is the id of the module in English
- 'yy' is the id of the module that is the translation of module with id=xx into Spanish
Then: whenever the string {loadmoduleid xx} is found in the English text, this string will be replaced by the string {loadmoduleid yy} in the text translated into Spanish.
Rule 4A. Replace an id between delimiters in the text of the source language with the id translation into the target language.
In this rule the Trigger is mandatory. The id is the string between delimiters.
For this process to work properly, there must be a translation, known to KMFasTrans, of the module whose id is xx, to the target language. This will always be true if the module whose id is xx has been translated using KMFasTrans before translating the article containing the string. If the translation of the module whose id is xx is not found, the same existing xx in the source language will be preserved in the target language.
Example:
Parameters set on the General tab: (The trigger can not contain spaces)
- Trigger: module
- Applies to: 'Default curly brackets' . We are assumning that 'Default curly brackets' is configured as a pair of tags and the tags are { and }
- Opening delimiter: [
- Closing delimiter: ]
- Component: Modules
Process performed:
Let's assume that:
- The source language is English and the target language is Spanish
- 'xx' is the id of the module in English
- 'yy' is the id of the module that is the translation of module with id=xx into Spanish
Then: whenever the string {module [xx]} is found in the English text, this string will be replaced by the string {module [yy]} in the text translated into Spanish
Rule 5. Special for modules. Replace the title xxx of a module in the source language, by the corresponding title in the target language.
For this process to work properly, there must be a translation, known to KMFasTrans, of the module whose title is xxx, to the target language. This will always be true if the module with title xxx has been translated using KMFasTrans before translating the article containing the string. If the translation of the module whose title is xxx, is not found, the same existing title xxx in the source language will be preserved in the target language.
This rule must be configured in the following way:
Example
Parameters set on the General tab: (The trigger can not contain spaces)
- Trigger: loadmodule
- Applies to: 'Default curly brackets' . We are assumning that 'Default curly brackets' is configured as a pair of tags and the tags are { and }
- Component: Modules
Process performed:
Let's assume that:
- 'trigger' is loadmodule
- 'type' is the module type
- 'source_title' is the module title in the source language
- style is the module style (which is optional)
- 'target_title' is the title of the module in the target language which is the translation into the target language of the module whose title is 'source_title' in the source language.
Then: whenever the string , is found in the text in the source language, this string will be replaced by the string
in the text translated into the target language.