Coder Social home page Coder Social logo

How do you handle l10n ? about go-i18n HOT 15 CLOSED

nicksnyder avatar nicksnyder commented on July 30, 2024
How do you handle l10n ?

from go-i18n.

Comments (15)

deankarn avatar deankarn commented on July 30, 2024 4

Hello @nicksnyder @abourget and @ghost

I recently completed a package locales that may be of use. I created it for use in my own i18n package, but split the code into it's own repo in order for any other i18n or l10n package to use if they wanted.

My goal is to create a central package for locale information and formatting and have people wrap it as they wish.

All information is generated using the CLDR rules and information.

It features:

  • Rules generated from the latest CLDR data, v29
  • Cardinal, Ordinal and Range Plural Rules
  • Month, Weekday and Timezone translations built in
  • Date & Time formatting functions
  • Number, Currency, Accounting and Percent formatting functions

I hope this can help πŸ˜„

from go-i18n.

nicksnyder avatar nicksnyder commented on July 30, 2024

This library does not currently handle date and number formatting. If we added support, I ideally would want to generate the code from the CLDR data much like we do for plural configuration.

from go-i18n.

abourget avatar abourget commented on July 30, 2024

CLDR data has all of that ? I don't know much about CLDR but I might be
willing to take a bite at it. Do you have references ?

Le sam. 9 janv. 2016 17:45, Nick Snyder [email protected] a Γ©crit :

This library does not currently handle date and number formatting. If we
added support, I ideally would want to generate the code from the CLDR data
much like we do for plural configuration.

β€”
Reply to this email directly or view it on GitHub
#45 (comment).

from go-i18n.

nicksnyder avatar nicksnyder commented on July 30, 2024

Number formatting:
http://cldr.unicode.org/translation/number-patterns

Date formatting
http://cldr.unicode.org/translation/date-time-patterns
http://cldr.unicode.org/translation/date-time-patterns

Download the raw XML data files here:
http://unicode.org/Public/cldr/28/core.zip

Look at core/common/main/en.xml (search for dateFormatItem and decimalFormats)

from go-i18n.

 avatar commented on July 30, 2024

any movement on this ?

from go-i18n.

nicksnyder avatar nicksnyder commented on July 30, 2024

Not that I am aware of. If this is something that is of interest to you then feel free to work on it.

from go-i18n.

abourget avatar abourget commented on July 30, 2024

Yeah I'd be glad if you do :-)

Le dim. 26 juin 2016 15:15, Nick Snyder [email protected] a Γ©crit :

Not that I am aware of. If this is something that is of interest to you
then feel free to work on it.

β€”
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#45 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAFs8DIgEaE6I3DzdHOPy-_JWIY9eSVVks5qPs_PgaJpZM4HBoV9
.

from go-i18n.

 avatar commented on July 30, 2024

@nicksnyder

Have you seen this ? Its handles l10n according to the readme.

https://github.com/maximilien/i18n4go

  • is a full workflow, which i was looking for.
  • is up to the language translation team to do it.

Its using this repo as a dependency.

Seems to me like a great approach, and well done

from go-i18n.

 avatar commented on July 30, 2024

@abourget
i am also starting work on this with another guy.

also there is some great best pracs here:
https://github.com/astaxie/build-web-application-with-golang/blob/master/en/10.1.md
about 6 pages, that i think we will fully integrate so everyone has options.

from go-i18n.

 avatar commented on July 30, 2024

weird. golang has first class support for using the cldr xml data
https://godoc.org/golang.org/x/text/unicode/cldr

funny that the golang team did not use this to create first class tooling for us already.

mhhh.... anyone knwo why ?

from go-i18n.

abourget avatar abourget commented on July 30, 2024

Wow thats great! Thanks for sharing here.

On Tue, Sep 13, 2016, 8:49 AM Dean Karn [email protected] wrote:

Hello @nicksnyder https://github.com/nicksnyder @abourget
https://github.com/abourget and @ghost https://github.com/ghost

I recently completed a package locales
https://github.com/go-playground/locales that may be of use. I created
it for use in my own i18n package, but split the code into it's own repo in
order for any other i18n or l10n package to use if they wanted.

My goal is to create a central package for locale information and
formatting and have people wrap it as they wish.

All information is generated using the CLDR http://cldr.unicode.org/
rules and information.

It features:

  • Rules generated from the latest CLDR
    http://cldr.unicode.org/index/downloads data, v29
  • Cardinal, Ordinal and Range Plural Rules
  • Month, Weekday and Timezone translations built in
  • Date & Time formatting functions
  • Number, Currency, Accounting and Percent formatting functions

I hope this can help πŸ˜„

β€”
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#45 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAFs8OHMOJ50qb2ZwiancbjtM-63TeQ1ks5qppvsgaJpZM4HBoV9
.

from go-i18n.

joeblew99 avatar joeblew99 commented on July 30, 2024

Wondering what i should use now ?

this repo OR https://github.com/go-playground/universal-translator ?

from go-i18n.

SCKelemen avatar SCKelemen commented on July 30, 2024

Is there any updates on this, or if no one is working on it, are there at least smaller bits of it that I could pick up and implement?

from go-i18n.

deankarn avatar deankarn commented on July 30, 2024

I don't know if anyone is working on this @SCKelemen

But in theory all that would have to be done to get l10n working in this project would be to map the locales from this library to the locales in https://github.com/go-playground/locales, which contains l10n functions.

from go-i18n.

nicksnyder avatar nicksnyder commented on July 30, 2024

The focus of this library is translating messages.

For other types of localization check out http://golang.org/x/text or other 3rd party libraries mentioned in this thread.

from go-i18n.

Related Issues (20)

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.