1.0.0 • Published 3 months ago

@xml-locales/cli v1.0.0

Weekly downloads
-
License
-
Repository
github
Last release
3 months ago

@xml-locales/cli

NPM

This is cli tool to work with localization files in xml.

Installation

npm install -g @xml-locales/cli
yarn global add @xml-locales/cli
pnpm add -g @xml-locales/cli

!IMPORTANT This package, which works with XML files, has one root node named resources. This root node has child nodes named string. For example:

<resources>
  <string name="key1">value1</string>
  <string name="key2">value2</string>
</resources> 

Or use without

npx @xml-locales/cli <command> [...args]

Commands

Add Command

The add command is used to add a new key(s)-value(s) pair to the XML localization file or files from directory.

xml-locales add --path path/to/file_or_directory --keys newKey --values newValue
FlagAliasDefaultDescription
--path-pprocess.cwd()The path to the XML localization file or directory where the key-value pair will be added.
--keys-kNoneThe new key(s) to be added.
--values-vNoneThe value(s) to be associated with the new key.

Remove Command

The remove command is used to remove a key(s)-value(s) pair from the XML localization file or files from directory.

xml-locales remove --path path/to/file_or_directory --keys keyToRemove --values valueToRemove
FlagAliasDefaultDescription
--path-pprocess.cwd()The path to the XML localization file or directory where the key-value pair will be removed.
--keys-kNoneRemoved string by the key(s).
--values-vNoneOr removed string by the value(s).

Update Command

The update command is used to update a key(s)-value(s) pair in the XML localization file or files from directory.

xml-locales update --path path/to/file_or_directory --old oldValue --new newValue
FlagAliasDefaultDescription
--path-pprocess.cwd()The path to the XML localization file or directory where the key-value pair will be updated.
--old-oNoneThe old key(s) or value(s) to be updated.
--new-nNoneThe new key(s) or value(s) to replace the old one.

Sort Command

The sort command is used to sort the keys in the XML localization file or directory in ascending or descending order.

xml-locales sort --path path/to/file_or_directory --direction asc_or_desc
FlagAliasDefaultDescription
--path-pprocess.cwd()The path to the XML localization file or directory where the keys will be sorted.
--direction-d'asc'The sort direction. Can be 'asc' for ascending order or 'desc' for descending order.

Packages

Packageversion
📦xml-localesNPM
💻@xml-locales/cliNPM
1.0.0

3 months ago

0.0.8

5 months ago

0.0.7

6 months ago

0.0.6

6 months ago

0.0.5

6 months ago

0.0.4

6 months ago

0.0.3

6 months ago

0.0.2

6 months ago

0.0.1

6 months ago