Intl.Locale.prototype.getTextInfo()

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Intl.Locale 인스턴스의 getTextInfo() 메서드는 이 로케일에 대해 ltr(왼쪽에서 오른쪽) 또는 rtl(오른쪽에서 왼쪽)을 가리키는 문자 순서를 반환합니다.

참고: 일부 브라우저의 일부 버전에서는 이 메서드가 textInfo라는 접근자 속성으로 구현되었습니다. 그러나 접근할 때마다 새로운 객체를 반환하기 때문에 locale.textInfo === locale.textInfofalse를 반환하는 상황을 방지하기 위해 이제 메서드로 구현되었습니다. 자세한 내용은 브라우저 호환성 표를 참조하세요.

구문

js
getTextInfo()

매개변수

없음.

반환 값

UTS 35의 레이아웃 요소에 지정된 로케일 데이터와 관련된 텍스트 입력설정 정보를 나타내는 객체입니다. 다음과 같은 속성이 있습니다.

  • direction
    • 로케일의 텍스트 방향을 나타내는 문자열입니다. "ltr"(왼쪽에서 오른쪽) 또는 "rtl"(오른쪽에서 왼쪽) 중 하나 일 수 있습니다.

예제

text info 얻기

주어진 Locale에 대해 지원하는 텍스트 방향을 반환합니다.

js
const ar = new Intl.Locale("ar");
console.log(ar.getTextInfo()); // { direction: "rtl" }
console.log(ar.getTextInfo().direction); // "rtl"
js
const es = new Intl.Locale("es");
console.log(es.getTextInfo()); // { direction: "ltr" }
console.log(es.getTextInfo().direction); // "ltr"

명세서

Specification
Intl Locale Info Proposal
# sec-Intl.Locale.prototype.getTextInfo

브라우저 호환성

Report problems with this compatibility data on GitHub
desktopmobileserver
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Deno
Node.js
getTextInfo

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
See implementation notes.
Uses a non-standard name.
Has more compatibility info.

같이 보기