Code Monkey home page Code Monkey logo

localys's Introduction

Localys

2017-07-01 -> 2021-03-05

A locale helper for your apps.

This is part of the universe framework.

Install

Using the planet installer via light-cli

lt install Ling.Localys

Using the uni command.

uni import Ling/Localys

Or just download it and place it where you want otherwise.

How to

<?php

use Ling\Localys\Localyser\Localyser;

// your autoloader here...

$localyzer = Localyser::create()->setDefaultLang('fra');
a($localyzer->get()->getMonth(2)); // février

Before you can use the code above, you need to create a Localys instance per lang that you use.

A Localys instance is an object that you create, which must implement the LocalysInterface.

The Localyser object is a finder for Localys instances.

By default, it searches a class under the namespace MyLocalys.

So, assuming that you have a bsr-0 autoloader ready, and assuming your use the lang "eng", then you need to create a class named EngLocalys, that's it.

Do that for all languages that your application uses.

You can find default Localyses here: /Localys/Localyser/Localyser/_MyLocalysExample.

Copy paste them into your app, or if it does not exist, create it, and please make a pull request if you want.

Enjoy!

Philosophy

Rather than creating one object that every country can use, containing all possible locale data, why not let every country build its own locale object, bit by bit, and only the used bits?

History Log

  • 1.9.4 -- 2021-05-31

    • Removing trailing plus in lpi-deps file (to work with Light_PlanetInstaller:2.0.0 api
  • 1.9.3 -- 2021-03-05

    • update README.md, add install alternative
  • 1.9.2 -- 2020-12-08

    • Fix lpi-deps not using natsort.
  • 1.9.1 -- 2020-12-04

    • Add lpi-deps.byml file
  • 1.9.0 -- 2018-06-19

    • add LocalysInterface.getTimeElapsedString method
  • 1.8.0 -- 2018-05-29

    • add LocalysFrenchHelper class
  • 1.7.0 -- 2018-05-04

    • add LocalysInterface.getLongDateWithTime method
  • 1.6.0 -- 2017-12-02

    • add LocalysInterface.getLongDateRangeBits method
  • 1.5.0 -- 2017-09-26

    • add LocalysInterface.getLongerDate method
  • 1.4.0 -- 2017-09-11

    • add LocalysInterface.getDayNameLong method
    • add LocalysInterface.getDayNameAbbr method
  • 1.3.0 -- 2017-08-23

    • add LocalysInterface.getGenderAbbreviation method
  • 1.2.1 -- 2017-07-07

    • fix LocalysInterface.getLongDateRange method
  • 1.2.0 -- 2017-07-07

    • add LocalysInterface.getLongDateRange method
  • 1.1.0 -- 2017-07-01

    • add LocalysInterface.getLongDate method
  • 1.0.0 -- 2017-07-01

    • initial commit

localys's People

Contributors

lingtalfi avatar

Watchers

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