Vietnamese translation of Zictionary (#903)
Co-authored-by: Hưng Nguyễn <>
This commit is contained in:
@@ -59,10 +59,13 @@ end
|
||||
local function _search()
|
||||
local input=inputBox:getText():lower()
|
||||
_clearResult()
|
||||
-- This change was made by Sea. Should the search function prioritize the best match result and move it to the top of the search result
|
||||
-- Usually yes except Vietnamese version of Zictionary
|
||||
local prioritizeBestMatch=not SETTING.locale:find"vi"
|
||||
local first
|
||||
for i=1,#dict do
|
||||
local pos=find(dict[i].title:lower(),input,nil,true) or find(dict[i].keywords,input,nil,true)
|
||||
if pos==1 and not first then
|
||||
local pos=find(dict[i].title:lower(),input,nil,true) or find(dict[i].keywords:lower(),input,nil,true)
|
||||
if pos==1 and not first and prioritizeBestMatch then
|
||||
ins(result,1,dict[i])
|
||||
first=true
|
||||
elseif pos then
|
||||
@@ -76,7 +79,7 @@ local function _search()
|
||||
end
|
||||
|
||||
function scene.enter()
|
||||
dict=require("parts.language.dict_"..(SETTING.locale:find'zh' and 'zh' or SETTING.locale:find'ja' and 'ja' or 'en'))
|
||||
dict=require("parts.language.dict_"..(SETTING.locale:find'zh' and 'zh' or SETTING.locale:find'ja' and 'ja' or SETTING.locale:find'vi' and 'vi' or 'en'))
|
||||
_scanDict(dict)
|
||||
|
||||
inputBox:clear()
|
||||
|
||||
Reference in New Issue
Block a user