Skip to content
This repository has been archived by the owner on May 20, 2024. It is now read-only.

CLI scripts syntax

Francesco Lodolo edited this page Sep 11, 2017 · 10 revisions

Available CLI commands

add_tags

Add missing tag to a specific file (only mozilla.org)

General syntax

./app/scripts/add_tags [lang_filename]

export_surveys

Export completely localized survey files to Excel format (.xls). These files can be manually imported in SurveyGizmo (only surveys)

General syntax

./app/scripts/export_surveys [lang_filename] [export_path]

import_po

Import a local .po file into a .lang file

General syntax

./app/scripts/import_po [po_filename] [lang_filename]

import_transvision_id

Use Transvision API to read a specific string ID, store translation in the .lang file if not already translated.

General syntax

./app/scripts/import_transvision_id [lang_filename] [repo] [string_id]

Examples

./app/scripts/import_transvision_id main.lang aurora mobile/android/base/sync_strings.dtd:fxaccount_status_legal

Import translation for the requested string ID from Aurora into main.lang

import_transvision_string

Use Transvision API to get a translation for a string, store translation in the .lang file if not already translated.

General syntax

./app/scripts/import_transvision_string [lang_filename] [repo] [string]

Examples

./app/scripts/import_transvision_string main.lang aurora "Legal"

Import translation for "Legal" from Aurora into main.lang

lang_update

Update lang files: adding new strings from reference locales, removing tags, etc.

General syntax

./app/scripts/lang_update [lang_filename] [website_id] [locale_code]

Examples

./app/scripts/lang_update mozorg/home.lang 0 all

One file, all locales. 2nd and 3rd parameters are optional for mozilla.org, element 0 in $sites.

./app/scripts/lang_update mozorg/home.lang 0 fr

One file, one locale (French in this case).

./app/scripts/lang_update all 0 fr

All files, one locale (French in this case).

./app/scripts/lang_update all 0 all

All files, all locales.

mark_active

General syntax

./app/scripts/mark_active [lang_filename]

Mark active a file, if completely translated, for all locales. Supports only mozilla.org

mark_not_active

General syntax

./app/scripts/mark_not_active [lang_filename]

Remove the active tag from a file, for all locales. Supports only mozilla.org

untracked_files

General syntax

./app/scripts/untracked_files [websiteid] [locale] [absolute]

This script can be used to list, and potentially delete, untracked files from a repository. If called without parameters, it will display a list of all untracked files for mozilla.org, for all locales, with relative paths.

The output can be run from the root of the repository, and piped to actually delete the files. For example:

cd /path/to/www.mozilla.org
/path/to/langchecker/app/scripts/untracked_files | xargs git rm $1