Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 373
- Log:
Initial import of Radiant 0.9.1, which is now packaged as a gem. This is an
import of the tagged 0.9.1 source checked out from GitHub, which isn't quite
the same as the gem distribution - but it doesn't seem to be available in an
archived form and the installed gem already has modifications, so this is
the closest I can get.
- Author:
- rool
- Date:
- Mon Mar 21 13:40:05 +0000 2011
- Size:
- 985 Bytes
1 | module Radiant::AvailableLocales |
2 | |
3 | def self.locale_paths |
4 | root_locales = [File.join(RADIANT_ROOT, 'config', 'locales'), File.join(RAILS_ROOT, 'config', 'locales')].uniq |
5 | unless root_locales.empty? |
6 | Radiant::ExtensionLoader.locale_paths.dup + root_locales |
7 | else |
8 | Radiant::ExtensionLoader.locale_paths |
9 | end |
10 | end |
11 | |
12 | def self.locales |
13 | available_locales = {} |
14 | |
15 | locale_paths.each do |path| |
16 | if File.exists? path |
17 | Dir.new(path).entries.collect do |x| |
18 | result = x =~ /\.yml/ ? x.sub(/\.yml/,"") : nil |
19 | # filters out the available_tags files |
20 | result =~ /\_available_tags/ ? nil : result |
21 | end.compact.each do |str| |
22 | locale_file = YAML.load_file(path + "/" + str + ".yml") |
23 | lang = locale_file[str]["this_file_language"] if locale_file[str] |
24 | available_locales.merge! Hash[lang, str] if lang |
25 | end.freeze |
26 | end |
27 | end |
28 | available_locales.sort_by{ |s| s[0] } |
29 | end |
30 | |
31 | end |