Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

google-spreadsheets-i18n-angular

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

google-spreadsheets-i18n-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.

latest
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

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.

FAQs

Package last updated on 05 Jan 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts