fix: fix error
This commit is contained in:
parent
360aecc3a5
commit
e4dbdede9b
4 changed files with 5 additions and 6 deletions
|
|
@ -45,7 +45,6 @@ myStore.color = Color3.fromRGB(0,0,0)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
> 1. 스토어를 생성함.
|
> 1. 스토어를 생성함.
|
||||||
> 2. 기본 값을 설정함.
|
> 2. 기본 값을 설정함.
|
||||||
> 3. 스토어를 호출해 레지스터를 얻어 등록함.
|
> 3. 스토어를 호출해 레지스터를 얻어 등록함.
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,8 @@ Quad 에는 귀찮은 언어관리를 자동으로 해주는 기능이 내장되
|
||||||
번역 테이블은 `#!ts Lang.New(LangName:string,{ [Locale]: string|(options)->string })` 다음을 이용해 만들 수 있으며.
|
번역 테이블은 `#!ts Lang.New(LangName:string,{ [Locale]: string|(options)->string })` 다음을 이용해 만들 수 있으며.
|
||||||
`#!ts Lang(LangName:string)(options)->register` 로 UI 에 적용시킬 수 있습니다.
|
`#!ts Lang(LangName:string)(options)->register` 로 UI 에 적용시킬 수 있습니다.
|
||||||
|
|
||||||
|
`#!ts Lang.Locales.Default` 는 일치하는 언어가 없을때 보여줄 언어입니다. 일반적으로 영어를 추천합니다.
|
||||||
|
|
||||||
=== "용법"
|
=== "용법"
|
||||||
|
|
||||||
```lua title="자세한 설명은 예제를 참고하세요"
|
```lua title="자세한 설명은 예제를 참고하세요"
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,7 @@ function module.init(shared)
|
||||||
local new = {}
|
local new = {}
|
||||||
local warn = shared.warn
|
local warn = shared.warn
|
||||||
local store = shared.Store
|
local store = shared.Store
|
||||||
local class = shared.Class
|
local PcallGetProperty = store.PcallGetProperty
|
||||||
local PcallGetProperty = class.PcallGetProperty
|
|
||||||
|
|
||||||
new.Locales = {
|
new.Locales = {
|
||||||
["Default"] = "default";
|
["Default"] = "default";
|
||||||
|
|
@ -168,7 +167,7 @@ function module.init(shared)
|
||||||
if quadType == "quad_register" then
|
if quadType == "quad_register" then
|
||||||
local function regFn()
|
local function regFn()
|
||||||
-- update handler
|
-- update handler
|
||||||
handler = self.handlers[new.CurrentLocale]
|
handler = self.handlers[CurrentLocale]
|
||||||
if not handler then
|
if not handler then
|
||||||
handler = self.handlers[new.Locales.Default]
|
handler = self.handlers[new.Locales.Default]
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -371,8 +371,7 @@ function module.init(shared)
|
||||||
self[key] = setValue
|
self[key] = setValue
|
||||||
end
|
end
|
||||||
item:Register(regFn)
|
item:Register(regFn)
|
||||||
insert(selfKeep,item)
|
insert(selfKeep,{func=regFn,register=item,key=key})
|
||||||
insert(selfKeep,regFn)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue