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. When placed on a field, it defines the display label for that field.
@QfEntity(
appKey = "app",
name = @QfI18n(defaultMessage = "Product", texts = {
@QfI18nText(locale = "ko", message = "상품"),
@QfI18nText(locale = "ja", message = "製品")
})
)
public class ProductEntity {
@QfI18n(defaultMessage = "Product Name", texts = {
@QfI18nText(locale = "ko", message = "상품명")
})
@QfListAttribute(sortable = true)
@QfCreateAttribute(requiredOn = @QfRequiredOn(always = true))
private String name;
@QfI18n(defaultMessage = "Price")
@QfListAttribute(sortable = true)
private Integer price;
}@QfDisplayHint
Declares a tooltip or placeholder hint for a field.
@QfI18n(defaultMessage = "Email")
@QfDisplayHint(text = "Enter in example@company.com format")
@QfCreateAttribute
private String email;| Attribute | Description |
|---|---|
key | Message resource key for i18n resolution |
text | Literal hint text (fallback) |
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