Code Monkey home page Code Monkey logo

tap-i18n-ui's Introduction

tap-i18n-ui

UI helpers for the tap-i18n package

Install

$ meteor add tap:i18n-ui

### Additional Templates

To generate a series of select language buttons for Bootstrap or Semantic UI:

{{> i18n_buttons}}            // Bootstrap
{{> i18n_buttons_semantic}}   // Semantic UI

To provide a dropdown <select> list of available languages:

{{> i18n_dropdown}}             // Bootstrap
{{> i18n_dropdown_semantic}}    // Semantic UI

Both templates sort languages list by country code.

Template Helpers

If you want to implement your own UI, tap-i18n-ui facilitates this with handlebars helpers

i18n_currentLanguage Returns an object with and localized name, language tag, and english translation en.

{{i18n_currentLanguage.name}} - {{i18n_currentLanguage.en}}

Including the above snippet in your template will yield something like Français - (French)

tap-i18n-ui also provides some other handlebars helpers:

{{i18n_enabled}}                  // true if languages found
{{i18n_sortedLanguages}}          // array of available languages
{{i18n_isCurrentLanguage 'tag'}}  // true if given tag equals current language tag

tap-i18n-ui uses localStorage to save your language choice accross refreshes. You can use TAPi18n.setLanguageAmplify to do this yourself.

Events

You can define a TAPi18n._afterUILanguageChange function within your project to be called each time the language is changed using a tap-i18n-ui template.


More UI planned including flag-picker.

Thanks to tap-i18n package

MIT License

### Contributors

tap-i18n-ui's People

Contributors

istoramandiri avatar orion- avatar rcarter avatar theosp avatar

Watchers

 avatar  avatar

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.