Giter VIP home page Giter VIP logo

angular-resources-language's Introduction

Angular Resources Language

This document describes how to create different json-files and merge all of them into one json file. This is helpful if you use Angular + @ngx-translate

Table of Contents

Installation

Step 1: Install devDependencies

Install gulp and gulp-merge-json as devDependencies

npm install gulp gulp-merge-json --save-dev

Step 2: Copy gulpfile.js

Now copy the gulpfile.js and merge it with yours (if you already have a gulpfile.js).

Step 3 (Optional): Update your package json

You can add to your package.json under "scripts" a new script:

"scripts": {
    "language": "gulp i18n"
}

Step 4: Create folders and json files

In "resources/i18n" Folder (you can adjust the source path - see Adjustments) you can create folders like "home" and there you can create your language files "en.json" / "de.json" etc.

Execution

Run "gulp i18n" or "npm run language" to merge the json files. The result will be in your "src/assets/i18n" Folder (you can adjust the destionation path - see Adjustments).

Adjustments

You can adjust your gulpfile.js:

  • Line 8: Add more languages
  • Line 11: Set the source folder
  • Line 14: Set the destionation folder of the merged json file
  • Line 21-27: If you use Ionic, you can automatically execute the gulp task

angular-resources-language's People

Contributors

paulstelzer 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.