Language Agnostic

Sync

14. Juli 2023July 14, 2023 · 2 Min. Lesezeit2 min read

Flamewerk utilities 3 methods of providing language agnostic components and content.

CURRENTLY THE FOLLOWING LANGUAGES ARE SUPPORTED ( but are easily extended )

ENGLISH, DANISH, GERMAN, DUTCH, FRENCH, SPANISH

1# The Global language files#

Outside of the Flamewerk folder you will find a folder called locales. This folder contains files referencing the supported language.

     {
      "homepage": {
        "title": "Hej og velkommen til ",
        "subtitle": "Opret en hjemmeside."
         },
      "footer":{
        "rights":"Alle rettigheder forbeholdes."
         }
     }


      <p>
        {{ $t("homepage.subtitle") }}
      </p>

2# The content directory#

In the flamewerk folder you find the content folder this contains subfolders: en, da, de, es, nl, fr

When you set in the project.js file

    language: "en",

All default content should be stored in the en folder.

Example: if you have a translated file in the de folder if will load the translated version if no translation is present it defaults to the standard language folder.

3# In Component Translation#

In an effort to create components that are language agnostic out of the box, it is also possible to add the translation in the component using the local scope:

    <template>
      <div>
        <h2>
         {{ t('hello') }} 
        </h2>
      </div>
    </template>


    <script setup>
        const { t } = useI18n({ useScope: "local" });
    </script>


    <i18n lang="json">
    {  
      "da": {    
        "hello": "Hej og velkommen til " 
        },  
      "de": {    
        "hello": "Hallo und willkommen bei "  
        },
      "en": {
        "hello": "Hello and welcome at "
        },
      "es": {
        "hello": "Hola y bienvenidos a "
        },
      "fr": {
        "hello": "Bonjour et bienvenue chez " 
        },
      "nl": {
        "hello": "Ahoy en welkom bij " 
      }
    }
    </i18n>

4# Automated translation tools#

Some of these online solution suport i18n vue formatting allowing you to upload the files from the locales directory and get a clean fast translation. [

Translate your i18n Locales | Get Instant Results

Internationalize your Software and Documentation. Simply copy/paste your file to translate i18n locales - fast and customized.

simpleen

](https://simpleen.io/)[

Content & Software localization on autopilot

Software & content localization on autopilot. Productive software developers choose Localazy for automated SW i18n and content localization. Start for free now!

localazy.comLocalazy

](https://localazy.com/)[

Translation Management for software projects

Try out the most user-friendly software for managing translations. Help your dev and management team to cooperate better thanks to SimpleLocalize

SimpleLocalizeJakub

](https://simplelocalize.io/)

#Flamewerk Archive

Written by

Comments

No comments yet. Start the conversation.