Comments (5)
You can do this by creating a file in your theme in lib/views/public_body/_alphabet.html.erb. If this file exists, it will override the existing app/views/public_body/_alphabet.html.erb template. Example content could be something like:
<%- "\u05D0".upto("\u05EA") do |l| -%>
<%= link_to_unless (@tag == l), l, list_public_bodies_path(:tag => l.downcase) %>
<% end %>
from alaveteli.
If you want to keep English as a language option, then the file for Hebrew needs to be in the theme as lib/views/public_body/_alphabet.he-IL.html.erb instead.
from alaveteli.
Having looked at this a bit more today, I think getting the links to produce the right lists of public bodies for the two languages may depend on getting a core alaveteli issue resolved: mysociety#1000
from alaveteli.
@crowbot thanks. I'll be watching mysociety#1000 and check again once it's resolved and merged into our fork.
from alaveteli.
This made me think about the problem of how to generate the correct alphabet links automatically based on the locale. I think this probably isn't worth it, given that, as @crowbot explains above, overriding the alphabet list is easy to do in a theme, but, for the record, it could be done using data from the Unicode Common Locale Data Repository, which includes data on "index characters" for a locale:
For example, the exemplarCharacters
element for Hebrew is here:
http://unicode.org/cldr/trac/browser/tags/release-23-1/common/main/he.xml#L1111
Creating a gem that made that data easily accessible for Rails applications might be useful to the world at large, but perhaps not a good use of development time on Alaveteli at the moment.
from alaveteli.
Related Issues (16)
- Make Hebrew the default language HOT 5
- Figuring the category options HOT 4
- Preventing emails from getting to spam folders
- Sending timely reminders HOT 1
- Content to static pages and links
- Feed for twitter HOT 1
- Authorities list only appears under the English version HOT 1
- Tags only show in one language
- Text still shows as FOI request on an authority page
- Mails arrive to old email addresses
- Emails arrive with FOI in subject
- Destroying some requests brings up an error
- Viewing some requests results in an error HOT 1
- [here you write the Severity] here you write the title HOT 1
- RecordNotFound Error
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 alaveteli.