Skip to content

golgetc/language-switcher-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Language Switcher Example

This is a simple example demonstrating how to use a JSON file for language switching in a web app. The project uses JavaScript to fetch translations from a JSON file and updates the text content of the page accordingly.

Getting Started

To get started, simply clone this repository and open the index.html file in your browser.

git clone https://github.com/golgetc/language-switcher-example.git

How It Works

  1. The lang.json file contains translations for two languages: Turkish (tr) and English (en).
  2. The JavaScript code in index.html fetches the translations from the JSON file.
  3. The text content of the page is updated based on the selected language.
  4. Clicking the "Change Language" button toggles between the two languages.

Customizing Translations

To customize the translations or add more languages, simply edit the lang.json file and update the JavaScript code in index.html accordingly.

License

This project is released under the MIT License. See LICENSE file for more details.

About

Çoklu dil ile çalışırken, json kullanımı ve dil geçişleri. Ayrıca repo'da lang.json'da olabildiğince kullanılan kelimeleri Türkçe ve İngilizce olarak toplarladım.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages