Skip to content

Akifcan/localization_vue_3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

localization_vue_3

Manage your strings with localization_vue_3 package!

gif

Setup

import localization from 'vue_3_localization'
app.use(localization, {language: {useCurrentLanguage: true}}) // language is required
//or 
app.use(localization, {language: {useCustomLanguage: 'tr-TR'}}) // language is required


//if you want change path
app.use(localization, {language: {useCustomLanguage: 'tr-TR'}, customPath: 'your_path_here'}) // language is required


  <h1>{{ 'hello'.tr() }}</h1>
  <h1>{{ 'howryou'.tr() }}</h1>
  <h1>{{ 'thankyou'.tr() }}</h1>
  <h1>{{ 'okay'.tr() }}</h1>
  <h1>{{ 'cat'.tr() }}</h1>

Folder Structure

image

en-EN.json

    {
        "hello": "Hello",
        "howryou": "How are you?",
        "thankyou": "Thank you",
        "okay": "Okay",
        "cat": "Cat" 
    }

tr-TR.json

   {
        "hello": "Merhaba",
        "howryou": "Nasılsın?",
        "thankyou": "Teşekkür ederim",
        "okay": "Tamam",
        "cat": "Kedi" 
    }

fr-FR.json

   {
        "hello": "Salut",
        "howryou": "Comment vas-tu?",
        "thankyou": "Merci",
        "okay": "D'accord",
        "cat": "Chat" 
   }

Change language dynamically

 <button type="button" @click="getLanguage({useCustomLanguage: 'fr-FR'})">Change</button>

Example

About

Manage your strings with localization_vue_3

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published