languagepack
Manage language packs for internationalization (i18n) in your projects.
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 projectinit- Initialize a new language pack in the projectremove- Remove a language pack
Naming
The subcommand that creates a language pack is init, not create. There is no languagepack create and no languagepack get.
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)Verbose 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-444444444444languagepack init
Initialize (create) a new language pack in the project.
Usage
pfy languagepack init \
--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 init \
--project-id 01234567-89ab-cdef-0123-456789abcdef \
--identifier en \
--name "English"Regional variant:
pfy languagepack init \
--project-id 01234567-89ab-cdef-0123-456789abcdef \
--identifier es-MX \
--name "Spanish (Mexico)"Using short aliases:
pfy lp init --project-id 01234567-89ab-cdef-0123-456789abcdef --id fr --name "French"Output:
Language pack created successfully: French (fr)languagepack remove
Remove an existing language pack from the project.
Usage
pfy languagepack remove --languagepack-id <id>Flags
| Flag | Aliases | Required | Description |
|---|---|---|---|
--languagepack-id | --id | Yes | ID of the language pack to remove |
Example
pfy languagepack remove --languagepack-id eeeeeeee-ffff-0000-1111-222222222222Output:
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 init --project-id $PROJECT_ID --id en --name "English"
# Add additional languages
pfy languagepack init --project-id $PROJECT_ID --id es --name "Spanish"
pfy languagepack init --project-id $PROJECT_ID --id de --name "German"
pfy languagepack init --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