Transifex

  • Documentation
  • Projects & Content
  • Updating Content

Updating Content

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.

    resource-lang-breakdown.png#asset:4246

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.

Note

You can also use a file from a private repository in GitHub as long as the URL has the respective token that GitHub provides.

Transifex will check that URL for updates twice per day and if there are any changes to the file, it'll fetch the file and update the resource in Transifex. Because the check only happens twice 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.

    resource-page-header.png#asset:4262

  • 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.

    resource-automatic-update.png#asset:160

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.

Using the API or command-Line client to update source files

If you want to further automate your localization process, you can use Transifex's API or command-line client and integrate 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 which was translated in the past, translators will be able to 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 will be preserved in the Translation Memory.

  • Modified strings are added to Transifex

    In case of file with a key value structure, there are 2 different scenarios that might occur:

    1. Modified strings (values/source text)

    The text of an existing source string is modified but the key remains the same.

    e.g.

    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 translation of the string 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


    2. Modified strings (keys/identifiers)

    The key of an existing source string is modified but the source text remains the same.

    e.g.

    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 will automatically kick in all the previously submitted translations if the match is 100%. In case 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.

sfu1.png#asset:3458