Update Translated Files with File Rewrite Rules
There may be occasions when you need to make a change to your translations upon downloading the translated file, without updating the translations in the Translation Memory or anywhere on the Smartling dashboard. Such changes could include updating a single word or phrase, an entire string or block of text, or even a URL, similarly to performing a find and replace all within the translated file.
With File Rewrite Rules, Account Owners and Project Managers can define changes to be applied to translations within specific file types, for any language, within any project in your account.
If your translated file contains a URL, such as www.yourcomany.com, to protect the URL, the Smartling CAT Tool does not allow linguistics to edit a URL, but does allow them to place the URL in the correct position of the translation. Using File Rewrite Rules, you can create a rule that rewrites www.yourcompany.com to www.yourcompany.fr in French translated files, www.yourcompany.de in German translated files, etc. See how to create this rule below.
The rewrite is only visible in the downloaded supported file type, and not anywhere in the Smartling Dashboard. The rewrite is visible in pseudo, current and published file downloads. You can download the file from within the Job Details or from the Files tab. The File Rewrite Rule must be created before downloading the file.
Support File Types
- Microsoft Office - Excel, PowerPoint, Word
- Android XML
- iOS Strings
- Rich Text Format (RFT)
In cases where you want to create the one File Rewrite Rule to be applied to some or all languages, you can save time and effort by using the available variables:
- $locale: rewrites to each language's locale ID
- $language: rewrites to each language's language ID
- $country: rewrites to each language's country ID
All of Smartling's supported variables can be found in this article. A locale ID consists of a language ID and country ID.
Create a File Rewrite Rule
- In your Smartling Account, go to Account Settings > File Rewrite
- Click New Rule
- Complete the fields in the Rewrite Rule dialog:
- Choose a Project on the Account to apply the rule to
- Choose the languages the rule should apply to
- Choose the file types that should contain the rewrite rule once downloaded
- Add a Rule Description
- Enter what the rule should find and rewrite from
- Enter what the rule should replace all with and rewrite to
- Ensure the rule is enabled
- Click Save
Rewrite rules are case-sensitive and must be unique. If you create multiple rules with the same Rewrite From, for the same projects, languages and files types, the first rule that was created takes precedence over the rest.
To save time and effort in identifying each Rewrite Rule with a unique ID, Smartling automatically creates a unique Rule ID for each File Rewrite Rule create. This way you can quickly identify a rule, and if needed, reference this ID both internal and external communication.
Search & Filters
You can locate any rule quickly and easily by using the following search and filters:
- File Type
- Rewrite From
- Rewrite To
- Rule ID
It is possible to share your filter selection with another Account Owner or Project Manager user by sharing the URL.
Click the ellipses (3 dots) beside each File Rewrite Rule to complete any of the following actions, or you can also choose to carry out bulk actions by multi-selecting File Rewrite Rules and click the Actions button:
- Clone Rule - not available as a bulk action
Test Test Test
Always test any rule you create before implementing it with real content. Just as with any "Find & Replace All" action, Rewrite Rules are a powerful function that could potentially destroy your content if implemented without proper testing. Consider any possible corruption to the JSON or HTML in your content, including HTML in <tags>.