$i18n

Namespace

$i18n

Description:
  • 다국어 유틸리티

Author:
  • 이승갑 (dltmdrkq2@gmail.com)
  • 정민석 (whitn86@gmail.com)

Methods

(static) bind(comp, prop, code, doFitopt, formopt, typeopt)

Description:
  • 특정 컴포넌트의 프로퍼티에 다국어 메시지나 단어를 바인딩합니다.

Example
$i18n.bind(this.stt_title, "text", "SYS0000");
Parameters:
Name Type Attributes Default Description
comp nexacro.Component

다국어를 바인딩할 컴포넌트

prop Obejct

다국어 대상 프로퍼티

code string

다국어 코드

doFit boolean <optional>
true

바인드 완료후 즉시 위치 갱신 여부

form nexacro.FormBase <optional>

바인딩 대상 폼, 입력시 해당 form의 $i18nConstant 객체도 추가 참조

type "xstring" | "builtIn" <optional>
'xstring'

처리방법

  • xstring : xstring(nexacro 내장 기능)을 이용해 바인딩 처리를 합니다. 컴포넌트의 StringResource 탭에서 포시되는 property에서만 동작합니다.
  • builtIn : i18n의 자체 getText 기능을 이용합니다.
Returns:

생성된 바인딩 아이템

(static) changeLocale()

Description:
  • 현재 시스템의 locale값을 변경합니다.

Example
$i18n.changeLocale("ko_KR");

(static) clearBind()

Description:
  • 모든 화면의 모든 다국어 바인딩을 해제합니다.

Example
$i18n.clearBind();

(static) getVersion(type, locale) → {string}

Description:
  • 더이상 사용되지 않습니다. 넥사 자체 기능으로 수정하면서 더이상 버전관리 하지 않습니다. 언제나 '1.0'을 반환합니다.

Deprecated:
  • Yes
Example
$i18n.getVersion(type, locale);
Parameters:
Name Type Description
type "msg" | "word"

다국어 타입, "msg" : 메시지, "word" : 단어

locale string

버젼 확인할 언어 locale (ex : ko_KR, en_US)

Returns:

"1.0"

Type
string

(static) loadDataset(dataset, form)

Description:
  • Dataset을 읽어 다국어를 일제 Bind한다.

Example
$i18n.loadDataset(dataset, form);
Parameters:
Name Type Description
dataset nexacro.Dataset

다국어 정보 Dataset,

form nexacro.FormBase

dataset에 기입되어있는 Component들의 기준이될 form객체

(static) msg(code, optionopt, formopt) → {string}

Description:
  • 다국어 메시지를 가져온다. 필드 바인딩 기능이 필요할 경우 사용합니다.

Example
var msg = $i18n.msg("SYS0000");
var msg2 = $i18n.msg("SYS0010",{ locale: "en_US", field: ["Code Name", "Code"] });
Parameters:
Name Type Attributes Description
code string

메시지코드

option Obejct <optional>

메시지 옵션

Properties
Name Type Attributes Description
field Array.<string> <optional>

다국어 메시지의 field값, 메시지의 {0} {1} 에 순서대로 바인딩됨

locale string <optional>

국가코드

defaultVal string <optional>

기본값

form nexacro.FormBase <optional>

입력시 해당 form의 $i18nConstant 객체도 추가 참조

Returns:

다국어 메시지

Type
string

(static) reload(locale)

Description:
  • 서버로 부터 다국어 데이터를 갱신한다.

Example
$i18n.reload("en_US");
Parameters:
Name Type Description
locale String

갱신할 언어 locale (ex: ko_KR, en_US)

(static) unbind(comp, prop)

Description:
  • 특정 컴포넌트의 프로퍼티에 바인딩된 다국어정보를 해제합니다.

Example
$i18n.unbind(this.stt_title, "text");
Parameters:
Name Type Description
comp nexacro.Component

다국어를 바인딩할 컴포넌트

prop Obejct

다국어 대상 프로퍼티

(static) word(code, optionopt, formopt) → {string}

Description:
  • 다국어 단어를 가져온다. 필드 바인딩 기능이 필요 없을 경우 사용합니다.

Example
var word = $i18n.word("SYS0000");
var msg2 = $i18n.word("SYS0010",{ locale: "en_US", defaultVal: "Login"});
Parameters:
Name Type Attributes Description
code string

단어 코드

option Obejct <optional>

메시지 옵션

Properties
Name Type Attributes Description
locale string <optional>

국가코드

defaultVal string <optional>

기본값

form nexacro.FormBase <optional>

입력시 해당 form의 $i18nConstant 객체도 추가 참조

Returns:

다국어 단어

Type
string