Code Monkey home page Code Monkey logo

libglocal's Introduction

libglocal

A virion for localization.

Features:

  • Translations of the same locale can be split into different files to favour user-side editing
  • Flexible message grouping
  • Argument substitution by name No more confusing {$1}!
  • Argument validation
  • Argument defaults and cross-fallbacks
  • Advanced argument types, including:
    • list: argument accepts an array and implodes according to the delimiter defined by the translation
    • quantity: argument accepts a number, and it affects the following words according to the locale's custom plural rules
    • The developer can define custom argument types
  • Message substitution (include a message in another message)
  • Color stacking (after message substitution, the original color can be restored if changed)
    • Human-readable color/format codes, e.g. %{error}, %{hl1}, %{b}, actual color can be changed
  • Optional versioning to ignore outdated translations
  • Message ID constant class generator (CLI tool that automatically creates a PHP class/interface declaring constants for message IDs, so you can reference them from PHP code with your IDE checking for typos)
  • A PhpStorm plugin for editing libglocal lang files: https://github.com/SOF3/libglocal-idea-plugin

See en_US.lang for example syntax.

Libglocal Terminology

  • lang/locale: human language
  • language: programming language
  • message: something that can be translated
  • translation: the translation of a message in a specific locale

Libglocal developer guide

Libglocal is a virion. The Official Poggit Virion Documentation contains instructions for including a virion into your plugin.

Plugin developer (libglocal user) guide

See this document: Guide for developers, translators and server owners

libglocal's People

Contributors

poggit-bot avatar pugzy avatar sof3 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

pugzy

libglocal's Issues

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.