Lokalise Integration with Android

DevOks·2021년 6월 10일
0
post-thumbnail

OverView

이번 신규 앱 프로젝트에 다국어 리소스 관리를 위해 Lokalise라는 솔루션을 도입하게 되어서, 안드로이드 프로젝트에 통합하는 메뉴얼을 작성하게 되었다.

  • Lokalise 프로젝트 통합 연동 방법 중 2가지를 연동하였음.
    참조: Lokalise Integration Docs
    1. FastLane (Download via API)
    2. Github (Pull Requests)
      3. OTA - Platform SDK
      4. CLI / API

Fastlane - Dowloand via API

    desc "Download String Resource from Lokalise"
       lane :downloadLokalise do

        lokalise_download(
           api_token: "LOKALISE_API_TOKENM",
           project_identifier: "PROJECT_IDENTIFIER",
           destination: "app/src/main/res/",
           languages: ["en", "ko"]
         )
    	end
  1. fastlane downloadLokalise
    - 언어셋 다운로드
    - fastlane Action으로 직접 파일 다운로드 진행
    - 수정사항 발생은 Editor에서 확인하고 , App Branch 에서 커밋(푸시)한다.
    - Ref.
    - https://medium.com/@ryanisnhp/lokalise-and-fastlane-save-your-time-to-update-translation-95c8f58ea1dc
    - https://github.com/lokalise/lokalise-fastlane-actions

Github - pull requests

  • Ref : https://docs.lokalise.com/en/articles/1684090-github
  • Setup Guide
    1. GitHub 사이트에서 '퍼스널 토큰' 생성.
    2. Lokalise 사이트내의 'Integration > Github' 에 통합 설정 (토큰으로 Repo정보 접근 가능함)
    3. 설정
    4. Configuration 화면에 'Include full path in the filenames' 를 체크한다.
5. 동기화할 String 리소스의 파일들을 선택한다. 6. 설정완료후 시작하여 'Pull now' 실행.
  • Github으로의 Pull Request
    • 프로젝트 'Download' 에서 'Trigger > Github' 를 선택하여 Commit 메세지와 함께 Build(Only)하여 선택한 Repository에 Pull Request 생성.
    • 각 파일의 절대 디렉토리를 지정해야만 원하는 위치로 Pull Request 된다.
    • 언어셋 변경이 있을때마다 Lokalise 변경사항을 Pull Reqest 보내고 각 플랫폼 Github Repository에서 Merge하면 된다.
    • Logs 로그 확인


  1. 대시보드의 텍스트값의 줄바꿈(Line Break)이 '\n' 형식으로 컨버팅 되도록 하려면 다음의 옵션에 "Replace line breaks with \n" 을 체크한다.

profile
[Android] Software Engineer

0개의 댓글