Use Localazy, a software localization suite & translation management system, to take care of your Angular localization.
Choose from multiple developer-friendly options to start with Localazy. Integrate your Angular project the way that suits your workflow.
The best option for developers that want to make localization an automated part of their workflow.
Upload your texts and existing translations in any format directly to start quickly.
Add source keys via the web interface online and sync them into your project later.
Use the API to export translations and import content from/to Localazy programmatically.
To download translations to their original locations, you can follow these steps. First, in the localazy.json
configuration file and go to the download section. In this section, configure where you want to download your translations.
For a smoother process, ensure that you include the “path” parameter during the upload and use the same variable in the download section. Here’s an example of how to do it:
"upload": {
"files": [
{
"pattern": "src/**/locale/en.ts",
"lang": "inherited",
"path": "${path}"
}
]
},
"download": {
"files": [
{
"output": "${path}/${lang}.ts"
}
]
}
By setting the “path” parameter correctly, the translations will be downloaded to the respective locations specified in your localazy.json
configuration file.
After upgrading to macOS Big Sur, there’s a chance you may run into an issue with executing Localazy CLI. This is usually caused by incorrect configuration of brew
package manager. (Note that this doesn’t apply to binaries downloaded directly from our website, they should be working fine.)
The symptoms look like this, the process is killed without any further output.
To resolve the issue, go to App Store -> Updates and make sure, there’s no update available for Xcode. If yes, click “UPDATE” and wait for it to finish.
After the update, try to run brew doctor
and read the output carefully. There could be a warning about outdated CLT and suggested fix.
Let’s run the commands in the specified order and confirm all dialogues that might appear.
softwareupdate --all --install --force
,sudo rm -rf /Library/Developer/CommandLineTools
sudo xcode-select --install
Upgrade Localazy CLI to the latest version by running brew upgrade localazy/tools
And that’s all! You can now verify that Localazy CLI is working again with the localazy -h
command.
In the File Management section of Localazy, when downloading your files, you can select the desired format and download your strings in any of the available file formats.
Format Conversions feature is also an integral part of the Localazy CLI tool, so if you want to automate format conversions, you will need to install Localazy CLI on your preferred platform.
Read the article: How to convert localization files into different formats?
Note: Format Conversions are available only as a part of the Professional plan
There is no hard limit at the moment, but it’s recommended to keep the size of each individual item under 4kB. This corresponds to 4,000 characters encoded as UTF-8 and 2,000 characters encoded as UTF-16. Uploading longer texts won’t yield any errors, but might get refused by some external translation engines integrated in Localazy.
If you come across this issue, it is likely because you have exceeded your account’s source key limit or the changes you made haven’t been published yet. To resolve this, please go to the Billing section of your account to check your source key limit and consider upgrading if necessary. Additionally, you can visit your Project Activity Stream to verify if the project has been published.
When using Localazy CLI, setting up a comfortable POT/PO workflow requires some special settings, but is completely possible. Usually the source language file has a different format (POT) than files with translated strings in your project (PO).
We recommend setting two different rules for uploading:
messages.pot
file with "type": "pot"
and also provide the file
attribute to be sure that the filename is, in ideal case, something like messages.po
to properly link your POT file to a PO file that is used for your source language internally by Localazy. "type": "po"
and provide the same file attribute again.Your upload configuration should then look like this:
"files": [
{
"type": "pot",
"pattern": "source/messages.pot",
"file": "message.po"
},
{
"group": "existing-translations"
"type": "po",
"pattern": "translations/*/messages.pot",
"file": "message.po"
}
]
The Localazy CLI is a powerful tool designed to automate the process of uploading and downloading translation files in almost any project. If you encounter any issues or questions that are not addressed in the documentation, there’s no need to worry as we’re happy to help you to overcome these challenges.
Simply reach out to us through our chat, and we’ll make every effort to assist you promptly. Alternatively, you can send an email to [email protected], providing your configuration details and a clear description of your goal. We will respond as quickly as possible to ensure your seamless experience with Localazy.
Suppose you have a project where the source file is a JSON file with a row in the format:
"about.moreButton": "Learn more on our website",
When using the Localazy CLI to import to Android with Format Conversions (or when you just try to export the JSON file to Android XML inside the Localazy web platform), you might notice that the format is:
<string name="about_moreButton">"Learn more on our website"</string>
Now, you might think you should delete those start and end quotation marks in the body of the XML row to achieve this result:
<string name="about_moreButton">Learn more on our website</string>
However, you can keep the quotation marks in the Android XML file because it’s a supported construct used to correctly encode white characters that would otherwise be lost in all cases. Quotation marks ensure that the exact form of your strings is preserved after conversion.
In actual use, the text will render correctly on the device.
More information can be found on the Android Developers website: String Resources
As a developer, connecting to your Localazy project via Localazy CLI requires you to provide your unique readKey
and writeKey
to authorize upload and download operations.
You need to have the Owner role in the project to access your unique access keys. Then, navigate to the project and open the left menu to find Settings ->Access Keys
Learn more in the Localazy CLI: Authorization
Yes, absolutely. You can have multiple files in different folders uploaded to the same project.
You can include files by their exact path or by using standard path wildcards ?
(single character), *
(anything except path separator), **
(anything including path separators).
You can control files you want to upload with exclusion rules and conditions.
Example:
"upload": {
"type": "json",
"files": "modules/**/en.json"
}
}
The above configuration will scan for files named en.json in all subfolders of the modules folder.