Giter VIP home page Giter VIP logo

discourse-locale-override's Introduction

discourse-locale-override

Simple plugin/boilerplate to override some of translations keys in Discourse and persist them between Docker rebuilds. Can be used by translators, early adopters of young locales or communities with specific slang.

This repository contains only pl_PL locale. See FAQ below if you need to override a different one.

Installation on top of Docker image

Add to your /var/discourse/containers/app.yml:

hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - mkdir -p plugins
          - git clone https://github.com/lidel/discourse-locale-override.git

Rebuild Discourse: /var/discourse/launcher rebuild app

FAQ

How can I use this to override locale X?

  1. Fork this repository
  2. Remove config/locales/*.pl_PL.yml files (optional)
  3. Add config/locales/*.xx_XX.yml ones Warning: xx_XX should be the language code you want to override. Files have to be already present in discourse/config/locales. This is important: adding non-existing locale codes will break your instance.
  4. Update repository URL in Docker hook to point to your fork

Where do I get original .yml files from?

There are two places I am aware of:

If you care about latest translations use Transifex. Github is updated with Transifex changes about once a week.

Can I override entire locale?

Yes, if your .yml file has translation for all keys the entire locale with be overridden.

Can I override only one label?

Yes, but make sure you understand YAML and all key segments used in label key are present. For example, to override pl_PL.site_settings.enable_emoji make sure that config/locales/server.pl_PL.yml has these three lines (one for each segment):

pl_PL:
  site_settings:
    enable_emoji: "Włącz wyświetlanie Emoji"

discourse-locale-override's People

Contributors

lidel avatar henrynet avatar

Watchers

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