Giter Site home page Giter Site logo

google-spreadsheets-i18n-angular's Introduction

Google spreadsheets i18n for Angular

The objective of this project is to use google spread sheets as source for a i18n mechanism using angularjs. To setup the source for the i18n follow the commands bellow.

Google Spreadsheets

Create a spreadsheet with the following structure. https://docs.google.com/spreadsheets/d/1QUICVJzTyIDcH2vk3UfnR4t0seo4r-cs3GuNum8Gz_M/edit?usp=sharing

  • Multiple sheets for multiple languages
  • Pair key value for messages

Spreadsheet printscreen

Google API Key

To use this plugin you will need to create a google api key and enable googlespread sheets API. Use the link below to create your api key https://console.developers.google.com/

Install

NPM

npm install --save-dev google-spreadsheets-i18n-angular

Bower

bower install --save-dev google-spreadsheets-i18n-angular

Setup

googleSpreadsheetI18nAngular.init(
      "spreadSheetKey",//Ex: "1QUICVJzTyIDcH2vk3UfnR4t0seo4r-cs3GuNum8Gz_M",
      "googleApiKey", // ex: "AIsasdaSdsazaSyB2CXqQxOfe22dYZlcpTAY20kjK0c",
      "defaultLanguage" // ex: "en-EN"
    )
    
    // Retrive languages from sheets
    googleSpreadsheetI18nAngular.getLanguage("pt-PT")
    googleSpreadsheetI18nAngular.getLanguage("en-EN")

    // Init scope variable
    $scope.i18n = googleSpreadsheetI18nAngular

Use

<h1>{{i18n.message('helloworld')}}</h1>
<h5>{{i18n.message('version')}}</h5>
<button ng-click="i18n.changeLang('pt-PT')">pt-PT</button>
<button ng-click="i18n.changeLang('en-EN')">en-EN</button>

License

Licensed under MIT.

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.