0.0.7 • Published 10 months ago

targams v0.0.7

Weekly downloads
-
License
ISC
Repository
-
Last release
10 months ago

Targams

Manage your language files and get translation easily

Get started

    npm install -D targams

Add a new script on your package.json

    {
        "scripts": {
            "targams": "targams-scripts"
        }
    }

Add a targams-config.json file on your root directory

    {
        "googleCredentialsFile": "<Path to your google credentials file : ./google_credentials.json>",
        "srcDirectory": "<Your-src-directory>",
        "refLanguage": "<Your-ref-language>"
    }

The google Credentials File is your google api service account keys : (Do not push it on you git repo)

    {
        "type": "<type>>",
        "project_id": "<project_id>",
        "private_key_id": "<private_key_id>",
        "private_key": "<private_key>",
        "client_email": "<client_email>",
        "client_id": "<client_id>",
        "auth_uri": "<auth_uri>",
        "token_uri": "<token_uri>",
        "auth_provider_x509_cert_url": "<auth_provider_x509_cert_url>",
        "client_x509_cert_url": "<client_x509_cert_url>",
        "universe_domain": "<universe_domain>"
    }

You can add exclude files on your source folder by setting an exclude param with array of files names:

    {
        "googleCredentialsFile": "<Path to your google credentials file>",
        "srcDirectory": "<Your-src-directory>",
        "refLanguage": "<Your-ref-language>",
        "exclude": ["file_to_exclude.json", "file_to_exclude_2.json"]
    }

On your source directory, create json files with your reference file and other target files. Files must be named with isoCode.json

    //./locales
FilesNameIsoCode
en-GB.json (ref file)en-GB
fr-FR.jsonfr-FR
de-DE.jsonde-DE
......

Run and get the magic:

    npm run targams

Target files are modified with missing keys compare to the ref file. N.B.: if a value contains a parameter like '{params}' this params will be not translate.

Erros

0.0.7

10 months ago

0.0.6

10 months ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago