Comments (6)
There are two places to add locale
- Server side https://github.com/anjlab/anjlab-widgets/blob/master/lib/anjlab-widgets.rb#L7
- Client side https://github.com/anjlab/anjlab-widgets/blob/master/app/assets/javascripts/anjlab/datepicker.js.coffee#L2
On client side we detect locale by <html lang>
attribute. On server side by ::I18n.default_locale
(and configured here https://github.com/anjlab/anjlab-widgets/blob/master/spec/dummy/config/application.rb#L35) in both cases we fallback to en
Right now it hardcoded. But any PR are welcome.
from anjlab-widgets.
I'm trying to add another translation to your gem, but I've some problems, I've changed the code that you show me, but don't use my locale.
- Client side (my html lang is set to 'es'): https://github.com/hermes-logicalbricks/anjlab-widgets/blob/master/app/assets/javascripts/anjlab/datepicker.js.coffee#L11
- Server side (my application default locale is 'es'): https://github.com/hermes-logicalbricks/anjlab-widgets/blob/master/lib/anjlab-widgets.rb#L12
I don't understand what I'm missing.
Thanks a lot for your response.
from anjlab-widgets.
Ok, I updated dummy app in your fork.
https://gist.github.com/yury/31db37c329bca7acd53e
go to spec/dummy and start rails app (rails s)
open /datepicker
check 4-th picker. It fallbacks to default location. http://cl.ly/image/0G1A0X3M3A1x
from anjlab-widgets.
Ok, Maybe I've another problem with my application where this change doesn't work. Thanks a lot for your support.
from anjlab-widgets.
Please be free to make PR with es locale.
Thank you
from anjlab-widgets.
Of course, I'll make the PR when my app works. Thanks a lot for your hard work on this gem.
from anjlab-widgets.
Related Issues (17)
- date picker only works for DateTime objects, not Dates
- uninitialized constant Anjlab HOT 6
- Bootstrap 3 HOT 2
- 24 Hour vs. AM/PM HOT 3
- Undefined variable: "$border-radius-base". HOT 18
- October month broken
- Ugly scrollbar on time picker
- License missing from gemspec
- Limit date
- How to set local?
- How to set locale to dd/mm/yy ?
- I'm using Castify https://play.google.com/store/apps/details?id=com.castify to watch web videos! Help me get credit for inviting you here at: http://castify.tv/invite/D9MOVJK HOT 1
- Highlight current date in date picker
- Use time and datepicker to format to strings HOT 1
- Multiparameter Assignment Error HOT 17
- Date Picker Prev/Next Year doesn;t work HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from anjlab-widgets.