Giter VIP home page Giter VIP logo

andrewjbateman / ionic-angular-localiser Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 1.0 4.79 MB

:clipboard: This project uses ngx translate, the internationalisation (i18n) library for Angular to change the content of the home page and alert button to the language chosen.

License: MIT License

JavaScript 9.48% TypeScript 64.42% HTML 10.03% SCSS 16.07%
ngx-translate services internationalisation language ionic typescript4 angular angular13 ionic6

ionic-angular-localiser's Introduction

โšก 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

ionic-angular-localiser's People

Contributors

andrewjbateman avatar

Watchers

 avatar  avatar

Forkers

sckumar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.