addon.doc.home / Sample manual
Internationalization
Three layers — do not mix:
- UI copy →
yt_lang+lang() - Business content →
ContentLang - Addon visitor config →
localize+Settings
Use lang('…') / {:lang('…')} everywhere. __() is the same lookup — avoid mixing styles in one small block.
Calls
lang('Operate success');
lang('Are you sure?');
Fast.api.confirm(lang('Are you sure?'), function (index) { /* … */ });
Store keys lowercase in yt_lang.
Feedback keys
Reuse: Are you sure?, Operate success, Operation failed, Cannot operate, Invalid parameters, Warning, OK, Cancel. CRUD nodes: Edit / Add / Delete / Multi.
RTL
html[dir] follows the UI language, not the region pack alone.
Settings / localize
Only string|text|editor may set localize=>true. PHP: settings('doc')->all(). API: GET /api/settings/module?module=doc&lang=en&client=app.
Region Packs
Core table is yt_region (model WorldRegion). Do not revive yt_area* for new work.
- Region Packs (Settings / Regions): country-level packs — ISO codes, phone dialing, currency, address format flags. Enough for most forms (country + state/province).
- Deeper address trees (city / district / …): install an optional region addon from the store when needed. Field lists, import steps, and pack codes belong on that addon's store page — not in this handbook.
API helpers (/api/ajax/area_tree, cities, get_city_by_lat) read yt_region and may fall back to legacy yt_area if present.
Schema extras (lng/lat/code/iso2/pack) are ensured by core RegionSchema (region addons may extend them on install/import).