languagepack
pfy languagepack lists, creates, reads, and removes a project's language packs. A language pack is one locale (such as en or es-MX) with a display name; applications use them for translations. All subcommands take the project ID, not the slug.
Synopsis
pfy languagepack <subcommand> [flags]Aliases: l, lang, lp
Description
Language packs provide internationalization support for your applications. Each language pack contains translations for a specific language/locale combination.
Subcommands
list- List all language packs in a projectcreate- Create a new language pack in the projectget- Get a single language pack by IDremove- Remove a language pack
languagepack init is a hidden, deprecated alias of create; use create.
languagepack list
List all language packs available in a project.
Usage
pfy languagepack list --project-id <project-id> [flags]Flags
| Flag | Required | Description |
|---|---|---|
--project-id | Yes | Project ID |
--limit | No | Maximum number of items to return; if unset, every item is fetched |
--offset | No | Number of items to skip before returning results; defaults to the first item |
Example
pfy languagepack list --project-id 01234567-89ab-cdef-0123-456789abcdefOutput:
Language Packs:
- English (en)
- Spanish (es)
- German (de)
- French (fr)
4 language packsVerbose output:
pfy --verbose languagepack list --project-id 01234567-89ab-cdef-0123-456789abcdefConnecting to ProductifyFW manager...
Fetching language packs for project ID '01234567-89ab-cdef-0123-456789abcdef'...
Found 4 language pack(s)
Language Packs:
- English (en)
ID: dddddddd-eeee-ffff-0000-111111111111
- Spanish (es)
ID: eeeeeeee-ffff-0000-1111-222222222222
- German (de)
ID: ffffffff-0000-1111-2222-333333333333
- French (fr)
ID: 00000000-1111-2222-3333-444444444444
4 language packslanguagepack create
Create a new language pack in the project. (languagepack init is a hidden, deprecated alias of this command.)
Usage
pfy languagepack create \
--project-id <project-id> \
--identifier <identifier> \
--name <name>Flags
| Flag | Aliases | Required | Description |
|---|---|---|---|
--project-id | Yes | Project ID | |
--identifier | --id | Yes | Language identifier (e.g., en, es-MX, de-DE) |
--name | Yes | Human-readable language pack name |
How the flags map onto the API
The two flags do not map onto the same-named GraphQL fields, because the manager's LanguagePack.name is the locale code:
--identifier(the locale code, e.g.en-US) is sent as the schema'sname.--name(the human-readable label, e.g.English (US)) is sent as the schema'sdisplayName.
There is no identifier field in the schema. See GraphQL Operations.
Examples
Basic language pack:
pfy languagepack create \
--project-id 01234567-89ab-cdef-0123-456789abcdef \
--identifier en \
--name "English"Regional variant:
pfy languagepack create \
--project-id 01234567-89ab-cdef-0123-456789abcdef \
--identifier es-MX \
--name "Spanish (Mexico)"Using short aliases:
pfy lp create --project-id 01234567-89ab-cdef-0123-456789abcdef --id fr --name "French"Output:
Language pack created successfully: French (fr)languagepack get
Get a single language pack by ID.
Usage
pfy languagepack get <id> --project-id <project-id>Flags
| Flag | Aliases | Required | Description |
|---|---|---|---|
--project-id | Yes | Project ID | |
--id | --languagepack-id | No | Language pack ID (or pass it positionally) |
Example
pfy languagepack get dddddddd-eeee-ffff-0000-111111111111 \
--project-id 01234567-89ab-cdef-0123-456789abcdefLanguage Pack: English (en)
ID: dddddddd-eeee-ffff-0000-111111111111languagepack remove
Remove an existing language pack from the project.
Usage
pfy languagepack remove --languagepack-id <id> [--yes]Flags
| Flag | Aliases | Required | Description |
|---|---|---|---|
--languagepack-id | --id | Yes | ID of the language pack to remove |
--yes | -y | No | Skip the confirmation prompt. Required under --ci or when stdin is not a terminal |
On a terminal you must type the ID back to confirm.
Example
pfy languagepack remove --languagepack-id eeeeeeee-ffff-0000-1111-222222222222 --yesOutput:
Language pack removed successfullyCommon Language Identifiers
| Identifier | Language |
|---|---|
en | English |
en-US | English (United States) |
en-GB | English (United Kingdom) |
es | Spanish |
es-MX | Spanish (Mexico) |
es-ES | Spanish (Spain) |
fr | French |
fr-CA | French (Canada) |
de | German |
de-AT | German (Austria) |
it | Italian |
pt | Portuguese |
pt-BR | Portuguese (Brazil) |
zh | Chinese |
zh-CN | Chinese (Simplified) |
zh-TW | Chinese (Traditional) |
ja | Japanese |
ko | Korean |
ar | Arabic |
ru | Russian |
pl | Polish |
nl | Dutch |
sv | Swedish |
da | Danish |
fi | Finnish |
no | Norwegian |
tr | Turkish |
he | Hebrew |
hi | Hindi |
Workflow Example
Setting Up Multi-language Support
# Get project ID
PROJECT_ID=$(pfy project get --slug my-saas | grep "ID:" | awk '{print $2}')
# Create base language (English)
pfy languagepack create --project-id $PROJECT_ID --id en --name "English"
# Add additional languages
pfy languagepack create --project-id $PROJECT_ID --id es --name "Spanish"
pfy languagepack create --project-id $PROJECT_ID --id de --name "German"
pfy languagepack create --project-id $PROJECT_ID --id fr --name "French"
# List all language packs
pfy languagepack list --project-id $PROJECT_IDGraphQL Operations
GetLanguagePacks
query GetLanguagePacks(
$project: ID!
$filters: [FilterInput!]
$order: [OrderInput!]
$pagination: PaginationInput
) {
languagePacks(
project: $project
filters: $filters
order: $order
pagination: $pagination
) {
id
name
displayName
}
}CreateLanguagePack
projectId is a required top-level argument, not a field of the input; the resolver overrides any project carried in the input with it.
mutation CreateLanguagePack($projectId: ID!, $input: CreateLanguagePackInput!) {
createLanguagePack(projectId: $projectId, input: $input) {
id
name
displayName
}
}Input Type:
input CreateLanguagePackInput {
"Language pack identifier (e.g., 'en-US', 'hu-HU') — the CLI's --identifier"
name: String!
"Human-readable display name (e.g., 'English (US)') — the CLI's --name"
displayName: String
}DeleteLanguagePack
mutation DeleteLanguagePack($id: ID!) {
deleteLanguagePack(id: $id)
}See Also
- project - Manage projects
- application - Manage applications
- pilet - Upload pilet packages