Knowledge Map

placeholder 에 angularjs translate적용하기 본문

WEB/AngularJS

placeholder 에 angularjs translate적용하기

2016. 3. 31. 11:36

알다 시피 angularJS는 translate를 적용가능해서 해당 기능만 만들면 쉽게 다국어 변형이 가능하다.

보통 l10n에서 많이 처리한다.


보통은 태그 안에 translate="경로 이름" 을 적는 방식으로 많이 하는데 placeholder에는 어떻게 적용을 할까?


1
<input type="text" placeholder="{{'요청하는 l10n의 해당 경로' |translate}}">
cs


이런식으로 한다. 예를 들어 content.example.test 이런식이면 


1
<input type="text" placeholder="{{'content.example.test' |translate}}">
cs


이렇게 해주면 된다.


==========================================================


angularJS내의 컨트롤로에서 $translate.instance('cotent.signup.text) 이런식으로 사용하게 되면  컨트롤러 내에서 translate를 통한 번역 처리가 가능하다.

'WEB > AngularJS' 카테고리의 다른 글

angularjs 윤년 처리  (0) 2016.04.01
angularJS에서 버튼 생성  (0) 2016.03.31
URL막기 / 단체 체크, 체그 해제  (0) 2016.03.29
  (0) 2016.03.21
AngularJS 셋팅  (0) 2016.02.22
Comments