Coder Social home page Coder Social logo

kdk_change_locale's Introduction

KDK Change Locale (v1.0.0 / Jan 2020)

Description

Change a WordPress site's locale based on active category.

This plugin assists when creating multi-lingual sites where each language is essentially a top-level category. By using category slugs like "en" or "es", this plugin can detect from the URL path the locale to set the site to.

E.g. if the category slug is "en", the locale will be set to en_US for US English. If it's "es", the locale will be set to es_ES for Spanish and so on.

Requirements

You need to have the desired languages installed in your WordPress site so the site's frontend (interface) properly switches to the correct language.

Modify

Define extra languages in the '$languages' array.

To Do

  • Add option to dynamically set the languages based on installed language packs in WordPress or add a WP backend UI to manually set the languages.
  • Inject JS code to append ?lang=X to URLs without a category prefix (e.g. tags).

Installation

Download the repo from https://github.com/kodeka/kdk_change_locale/archive/master.zip and extract the zip file. Rename the created folder to "kdk_change_locale". Zip that folder. Install the newly created zip file like any other WordPress plugin through the plugin manager.

License & Credits

Licensed under the GNU/GPL license (https://www.gnu.org/copyleft/gpl.html).

Copyright (c) 2018 - 2020 Kodeka Oรœ. All rights reserved.

kdk_change_locale's People

Contributors

fevangelou avatar kricore avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

everlive

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.