Comments (5)
The content for the plugin is currently hard-coded into a JS object:
https://github.com/sorry-app/status-bar/blob/master/src/javascripts/status-bar.js#L151-L167
I imagine pulling this out into a more complex object, which contains all the various languages, and then switching out based on the locale of the page returned by the API would be a decent first approach.
from status-bar.
Having checked the API documentation, it actually seems that the locale for the page isn't currently an attribute which is returned. So that'll be our first port of call.
Placing this issue on hold until the API presents the information we need.
from status-bar.
O.k the API now returns the page ISO two-letter locale, which is enough for us to dome a lookup in the plugin and select the right set of content.
from status-bar.
I've just merged a PR which adds support for languages, it uses the locale from the API, and then does a lookup from a JSON locale file within the plugin which contains all the translations.
from status-bar.
This was released in 4.5.0
and should be active for all customers once the Cloudfront cache is finished purging.
from status-bar.
Related Issues (20)
- Add Raven-JS Dependancy HOT 2
- README jQuery no longer required
- Allow customising of Content
- Utilise the new API filter/search options HOT 1
- Add support for additional states HOT 1
- Ellipsis '...' omission on truncated text not working HOT 3
- Include subject line in the displayed message. HOT 1
- Error: Uncaught (in promise): Cancel HOT 10
- No cache-control headers set HOT 11
- Missing timezone reference in status-bar HOT 3
- Add option to unable to delete HOT 4
- truncate message on mobile HOT 2
- Support url missing target blank property HOT 2
- Using custom location doesn't work HOT 1
- Correct version HOT 3
- Add Subresource Integrity to the readme HOT 4
- Initialisation fails when Page ID is numeric
- Doesn't work in Edge HOT 3
- Status bar requires `unsafe-inline` content-security-policy
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 status-bar.