Skip to content

Latest commit

 

History

History
89 lines (63 loc) · 3.66 KB

README.md

File metadata and controls

89 lines (63 loc) · 3.66 KB

⚡ Ionic Angular Localiser

GitHub repo size GitHub pull requests GitHub Repo stars GitHub last commit

📄 Table of contents

📚 General info

  • "The ngx-translate, the internationalisation (i18n) library for Angular lets you define translations for your content in different languages and switch between them easily.
  • It allows access to a service, a directive and a pipe to handle any dynamic or static content. The main part of the library is the 'core'. A loader was added to load translations into the app.

📷 Screenshots

Example screenshot Example screenshot Example screenshot

📶 Technologies

💾 Setup

  • Run npm i to install dependencies
  • Run ng lint to lint files - all files currently pass linting.
  • Run ng serve for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

💻 Code Examples

  • language.service.ts function to set app language using option selected by user.
// sets default language as browser language if no other language choice made
// if language language selected then this value is stored using the ionic storage module
setInitialAppLanguage() {
  const language = this.translate.getBrowserLang();
  this.translate.setDefaultLang('en');

  this.storage.get(LNG_KEY).then(val => {
    if (val) {
      this.setLanguage(val);
      this.selected = val;
    }
  });
}

🆒 Features

  • Select a language from the drop-down list and the language of headers, buttons, text alerts (as set up in the /assets/i18n/json files will change.

📋 Status & To-Do List

  • Status: Working
  • To-Do: Nothing

👏 Inspiration

📁 License

  • This project is licensed under the terms of the MIT license.

✉️ Contact