Giter Site home page Giter Site logo

Comments (5)

crowbot avatar crowbot commented on September 24, 2024

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.

crowbot avatar crowbot commented on September 24, 2024

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.

crowbot avatar crowbot commented on September 24, 2024

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.

yehudab avatar yehudab commented on September 24, 2024

@crowbot thanks. I'll be watching mysociety#1000 and check again once it's resolved and merged into our fork.

from alaveteli.

mhl avatar mhl commented on September 24, 2024

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)

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.