Internationalization (i18n)
Q-Framework declares multi-language strings via annotations. Localized display names can be defined directly in entity declarations, with no need to manage separate message files.
String Declaration
@QfI18n
The primary annotation for declaring localized display names.
@QfEntity(
appKey = "app",
name = @QfI18n(defaultMessage = "Product", texts = {
@QfI18nText(locale = "ko", message = "상품"),
@QfI18nText(locale = "ja", message = "製品")
})
)
public class ProductEntity {
@QfListAttribute(sortable = true)
@QfCreateAttribute(requiredOn = @QfRequiredOn(always = true))
@QfDisplayLabel(text = "Product Name")
private String name;
@QfListAttribute(sortable = true)
@QfDisplayLabel(text = "Price")
private Integer price;
}@QfI18nText
Declares additional text such as UI hints and placeholders.
@QfDisplayHint(
i18n = @QfI18nText(locale = "en", message = "Enter in example@company.com format")
)
@QfCreateAttribute
@QfDisplayLabel(text = "Email")
private String email;Key Rules
Localization keys are automatically generated at compile time.
{appKey}.{entityName}.field.{fieldName}
↓
app.product.field.name
app.product.field.priceEntity display name key:
{appKey}.{entityName}.label
↓
app.product.labelThese keys are automatically integrated with the frontend's i18n system.
Frontend Display Flow
Backend metadata API
↓
{
"fields": [
{
"name": "name",
"i18n": {
"defaultMessage": "Product Name",
"texts": [{ "locale": "ko", "message": "상품명" }]
}
}
]
}
↓
Frontend QfEntityView component
↓
Automatically selects display name based on current localeLanguage Configuration
Set the language in the frontend.
// q-vue configuration
import { createQFramework } from '@softminds/q-vue'
const qf = createQFramework({
locale: 'en', // default locale
fallbackLocale: 'en' // fallback locale
})When locale is en, the defaultMessage value is displayed. If a locale-specific text exists for the current locale, that value is used instead. If missing, it falls back to the defaultMessage.
Supported Languages
Currently supported languages:
| Code | Language |
|---|---|
en | English |
ko | Korean |
ja | Japanese |
zh | Chinese (Simplified) |
INFO
Language codes follow the ISO 639-1 standard. Additional languages can be added through SPI extensions.
Next Steps
- Change History — Track modification history
- Excel Features — Bulk data processing