Language aliased as 'zh-CN' is downloaded as 'zh_CN'
Description
Environment
Activity

Former user 4 August 2017 at 05:58Edited
,
Gettext project uses underscore for file naming and that is why our client replace hyphen with it.
The rule for Gettext project type
If you wish to override that rule, you can use our file mapping rules in zanata.xml to customise the output format
http://docs.zanata.org/en/release/client/configuration/#translation-files-mapping-rules
e.g.

Former user 4 August 2017 at 00:34
You log has
Check if you have old file stored as zh_CN.po. If yes, please remove it and also use
to try again (the cache is stored under .zanata-cache folder).
As for pt-BR being stored as pt_BR.po, that's the default for all gettext project (see at the bottom http://docs.zanata.org/en/release/client/configuration/)
If that's not what you want, you can either set alias or use file mapping rules in zanata.xml.

Former user 3 August 2017 at 17:40
There is actually the same problem with not aliased 'pt-BR' language being stored as 'pt_BR.po'.
Details
Details
Assignee
Reporter

Tested Version/s
Components
Affects versions
Priority

There is a language "zh-Hans-CN" in aliased as "zh-CN" in my project "ovirt-web-ui". When translations are pulled from zanata using zanata-cli, it is downloaded as "zh_CN.po" instead of zh-CN.po" (dash replaced by underscore).
zanata-cli console output correctly mentions the alias with dash, see below.
zanata.xml intentionally doesn't contain "<locale map-from=" mapping since it is discouraged by http://docs.zanata.org/en/release/client/configuration/#locale-configuration.
Console:
$ zanata-cli pull
/usr/bin/build-classpath: Could not find findbugs-annotations Java extension for this JVM
/usr/bin/build-classpath: error: Some specified jars were not found
[INFO] Loading project config from zanata.xml
[INFO] Loading user config from /home/jakub/.config/zanata.ini
[INFO] client API version: 4.2.1, server API version: 3.9.1
[WARN] client API version is 4.2.1, but server API version is 3.9.1
[INFO] Server: https://translate.zanata.org/
[INFO] Project: ovirt-web-ui
[INFO] Version: 1.1.0
[INFO] Username: jniederm
[INFO] Project type: gettext
[INFO] Enable modules: false
[INFO] Using ETag cache: true
[INFO] Purging ETag cache beforehand: false
[INFO] Locales to pull: [ja, it, fr, es, pt-BR, de, zh-Hans-CN(zh-CN), ru, ko]
[INFO] Encode tab as \t: true
[INFO] Current directory: /home/jakub/src/ovirt-web-ui
[INFO] Pulling target documents (translations) only
[INFO] Target-language base directory (translations): extra/from-zanata
[INFO] Minimum accepted translation percentage (message based): 0%
[INFO] Create skeletons for untranslated messages/files: false
[INFO] Pulling 1 of 1 docs for this module from the server
[?] This will overwrite/delete any existing translations in the above directory.
Are you sure (y/n)? y
[INFO] No translations found in locale ja for document messages
[INFO] No translations found in locale it for document messages
[INFO] No changes in translations for locale fr and document messages
[INFO] No translations found in locale es for document messages
[INFO] No translations found in locale pt-BR for document messages
[INFO] No translations found in locale de for document messages
[INFO] No changes in translations for locale zh-Hans-CN and document messages
[INFO] No translations found in locale ru for document messages
[INFO] No translations found in locale ko for document messages
zanata.xml:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<config xmlns="http://zanata.org/namespace/config/">
<url>https://translate.zanata.org/</url>
<project>ovirt-web-ui</project>
<project-version>1.1.0</project-version>
<project-type>gettext</project-type>
<src-dir>extra/to-zanata</src-dir>
<trans-dir>extra/from-zanata</trans-dir>
</config>
server: current translate.zanata.org 3.9.6 (git-server-3.9.6)
$ zanata-cli --version
/usr/bin/build-classpath: Could not find findbugs-annotations Java extension for this JVM
/usr/bin/build-classpath: error: Some specified jars were not found
zanata-cli
Client version: 4.2.1
Client timestamp: unknown
Client SCM describe: unknown
API version: 4.2.1
API timestamp: unknown
API SCM describe: unknown