Code Monkey home page Code Monkey logo

example-devextreme-intl's Introduction

Lokalizacija sa Devextreme Angular CLI

Instalacija

Instalirati https://www.npmjs.com/package/devextreme-intl sa komandom

npm install devextreme-intl -–save

Uvezivanje na nivou app

U app.mopdule.ts importovati potrebne module i sa njima importovati poruke i setovati locale

//import it to change locale and load localization messages
import { locale, loadMessages } from 'devextreme/localization'; 

import { DevExtremeModule } from 'devextreme-angular';
import 'devextreme-intl';

import { AppComponent } from './app.component';

//Load localized messages (English included by default)
let  messages_bs_Latn_BA = require("assets/localization/bs-Latn-BA.json");
loadMessages(messages_bs_Latn_BA);

// Set locale according the browser language
// locale(navigator.language);
// or
// Set locale explicitly
locale('bs-Latn-BA');

Primjer app.module.ts : https://github.com/MirzaAbazovic/example-devextreme-intl/blob/master/src/app/app.module.ts

Napraviti poruke za zeljeni jezik u i snimiti ih u json file u assets npr. assets/localization/bs-Latn-BA.json

Primjer bs-Latn-BA.json: https://github.com/MirzaAbazovic/example-devextreme-intl/blob/master/src/assets/localization/bs-Latn-BA.json

app.module.ts deklarise gdje mu se nalaze poruke sa linijom koda

let  messages_bs_Latn_BA = require("assets/localization/bs-Latn-BA.json");

a sa funkcijom locale postavlja lokale vezane za format decimale i datume

// Set locale according the browser language
locale(navigator.language);
// Set locale explicitly
locale('bs-Latn-BA');

Napomena

Chrome podrzava samo hr i sr lista na https://developer.chrome.com/webstore/i18n dok IE podrzava i bs-Latn-BA

Linkovi

example-devextreme-intl's People

Contributors

mirzaabazovic avatar

Watchers

James Cloos 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.