Table of Contents
Note This article only applies to file-based projects. |
When you're translating an app or website, you'll likely be adding and changing strings constantly, meaning the files with your source content will be changing too. Instead of uploading a new file and creating a new resource each time a file changes, you can simply update an existing resource. There are a few ways to update files in Transifex.
Manually updating source files
To manually update source files:
From the project navigation in the Dashboard, click on the project, which contains the file you want to update.
Click the Resources link.
Click on the resource you want to update.
In the header, click Update source file.
Automatically updating source files
Manually updating source files isn't fun or scalable if you've got frequent updates. To avoid this, you can have Transifex automatically check for updates to your source file. You simply need to provide Transifex with the public URL of the file. The file can be hosted on any service, such as GitHub or Dropbox. For services like Filezilla, though downloading is blocked for a script, automatically updating source files via URL is not supported.
Note You can also use a file from a private repository in GitHub if the URL has the respective token that GitHub provides. |
Transifex will check that URL for updates 4 times per day (every 6 hours), and if there are any changes to the file, it'll fetch the file and update the resource in Transifex.
Because the check happens 4 times a day, there may be a delay between when you update a file and when Transifex detects the changes. The updated resource will automatically be available to your translators and reviewers.
Here's how to set up automatic updates of source files:
Select a project from the project navigation in the Dashboard.
Click the Resources link.
In the header, click on Auto-update resources.
In the popup, click on the resource you want to auto-update.
Add the URL of your file and hit Update URL. Transifex will check to make sure the file can be accessed.
Note Please note that the file updates could be delayed due to the number of file update tasks the system needs to process. This means that the system may need 15 minutes more to process all the pending tasks in the queue for all the resources that are expected to be updated simultaneously. |
If you want to stop auto-updating a resource, simply remove the URL to the file. After doing so, you'll receive three warning emails letting you know the auto-update will fail. This is normal since Transifex checks the URL and sends out notifications whenever the URL isn't working.
Auto-Updating a Google Drive Resource
The format of the URL for auto-updating a spreadsheet from google drive is:
https://docs.google.com/spreadsheets/d/FILE_ID/export?format=xlsx
Using the API or command-Line client to update source files
If you want to automate your localization process further, you can use Transifex's API or command-line client and integrate it with your build process. This way, you can automatically push updated content to Transifex and pull translated files when they are complete.
What happens when you update files
A file is essentially a collection of strings. When you update a file, the following happens:
Identical strings that are in both the original file (e.g. file.po) and updated file (e.g. file_v2.po) > will remain in Transifex along with their translations.
New strings are added to Transifex > These strings will appear as untranslated.
If there is a similar string translated in the past, translators can use Translation Memory to help them translate the new string. If a 100% match is detected and Translation Memory autofill is enabled, all the previously submitted translations will be replicated within those new untranslated strings.
Strings from the original file are not present in the updated file anymore > These strings will not appear in Transifex.
If these strings were translated in the past, within the original file, the translation would be preserved in the Translation Memory.
Modified strings are added to Transifex
In the case of a file with a key-value structure, there are 2 different scenarios that might occur:
Modified strings (values/source text)
The text of an existing source string is modified, but the key remains the same.
e.g.
The initial version of the source string:
FORGOT_PASSWORD: "Forgot my password?";
|--------- key ----------------|-------------Value ----------|
New version:
FORGOT_PASSWORD: "Forgot password?";
--------- key ----------------|-------------Value ----------|
> After updating the source file, Transifex will identify that your text has been modified, so the string's translation should be evaluated again.
As a result:
Any previously submitted translation is removed from the translation area, and the string is considered an untranslated one.
The translation history of the string is being preserved and can be found under the History tab in the editor.
Any previously applied tags/instructions are preserved.
Any translators’ comments are preserved
Modified strings (keys/identifiers)
The key of an existing source string is modified, but the source text remains the same.
e.g.
The initial version of the source string:
FORGOT_PASSWORD: "Forgot my password?";
--------- key ----------------|-------------Value ----------|
New version:
FORGOT_MY_PASSWORD: "Forgot my password?";--------- key ----------------|-------------Value ----------|
After updating your source file:
The string with the modified key will be considered a completely new one.
Any comments/tags/history/translation of the previous entry will be lost since the entry with the previous version of the key is removed from your resource in Transifex.
However, the old translations are kept in the Translation Memory of your project. So, if you have the feature "Fill up resources from TM" enabled, TM will detect the old strings and automatically kick in all the previously submitted translations if the match is 100%. If the match is not 100%, previous translations appear in the “Suggestions” tab.
Here's a visual example. We have a source file with entities a, b, c translated in two languages. Then we push an update to it with entity c removed and an entity d added. The translated files are updated according to the new source file. In addition, the previous Italian translation (c → c'') is saved in the TM.