mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 19:41:51 +00:00
context-based translation test
This commit is contained in:
parent
4e6818fb7f
commit
e97eb441d5
5 changed files with 48 additions and 54 deletions
|
|
@ -131,3 +131,12 @@ void langs::setup(const path& resdir,
|
|||
const wstring& langs::get(const wstring& key) {
|
||||
return current->get(key);
|
||||
}
|
||||
|
||||
const wstring& langs::get(const wstring& key, const wstring& context) {
|
||||
wstring ctxkey = context + L"." + key;
|
||||
const wstring& text = current->get(ctxkey);
|
||||
if (&ctxkey != &text) {
|
||||
return text;
|
||||
}
|
||||
return current->get(key);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue