Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated Generator & Added Search add Add selected lang code to CSV column #11

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

dipaksarkar
Copy link

Sanitize Language Codes:

Modified the generation of import statements in the main index file to sanitize language codes by removing hyphens and converting them to camelCase.

"Key","English, en-US","French, fr","Hindi (India), hi_IN","Romanian (Romania), ro_RO"
"label.active","Active","Actif","सक्रिय","Activ"
"label.addAnnouncement","Add announcement","Ajouter une annonce","घोषणा जोड़ें","Adauga anunt"

// will be converted following

{
    label: {
        add: 'Active',
        addAnnouncement: 'Add announcement',
    }
}

Search and Add i18n Locale Codes

quasalang list-codes --add

? Enter a search query (e.g. "russian") or hit Enter to list all codes: italian

? Select languages to add: Russian, ru, Russian (Moldova), ru_MD

CSV file successfully written with new lang codes: Russian, ru, Russian (Moldova), ru_MD.

@dipaksarkar
Copy link
Author

dipaksarkar commented May 24, 2024

Added Following commands

parse

Usage: quasalang parse|p [options]

Parse your source files from (/src/**/*.{js,vue}) and Add them to (/translations.csv) as Default language

Options:
  -h, --help  display help for command

Example

Given the following label in your source files:

<base-label>{{ $t("// Phone Number") }}</base-label>
or
<base-label>{{ $t("// label::Phone Number") }}</base-label>

The command will convert them to:

<base-label>{{ $t("phoneNumber") }}</base-label>
or
<base-label>{{ $t("label.phoneNumber") }}</base-label>

The corresponding translation key will be added to translations.csv:

phoneNumber,"Phone Number"
or
label.phoneNumber,"Phone Number"

translate

Usage: quasalang translate|t [options]

Translate your CSV file using Google translate

Options:
  -h, --help  display help for command

check-trans

Usage: quasalang check-trans|ct [options]

Find missing trans key in (/translations.csv) from (/src/**/*.{js,vue})

Options:
  -h, --help  display help for command

trans-clean

Usage: quasalang trans-clean|tc [options]

Remove unused trans key from (/translations.csv)

Options:
  -h, --help  display help for command

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant