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:
- 2635 Bytes
1 | namespace :radiant do |
2 | namespace :i18n do |
3 | |
4 | desc "Syncs all available translations to the English master" |
5 | task :sync => :environment do |
6 | # All places Radiant can store locales |
7 | locale_paths = Radiant::AvailableLocales.locale_paths |
8 | # The main translation root, basically where English is kept |
9 | language_root = "#{RADIANT_ROOT}/config/locales" |
10 | words = TranslationSupport.get_translation_keys(language_root) |
11 | locale_paths.each do |path| |
12 | if path == language_root || path.match('language_pack') |
13 | Dir["#{path}/*.yml"].each do |filename| |
14 | next if filename.match('_available_tags') |
15 | basename = File.basename(filename, '.yml') |
16 | puts "Syncing #{basename}" |
17 | (comments, other) = TranslationSupport.read_file(filename, basename) |
18 | words.each { |k,v| other[k] ||= words[k] } # Initializing hash variable as empty if it does not exist |
19 | other.delete_if { |k,v| !words[k] } # Remove if not defined in en.yml |
20 | TranslationSupport.write_file(filename, basename, comments, other) |
21 | end |
22 | end |
23 | end |
24 | end |
25 | |
26 | desc "Creates or updates the English available tag descriptions" |
27 | task :available_tags => :environment do |
28 | descriptions = Hash.new |
29 | Page.tag_descriptions.sort.each do |tag, desc| |
30 | tag = ' ' + tag.gsub(':','-') + ':' |
31 | desc = desc.gsub(' ',' ') |
32 | descriptions[tag] = ' "' + desc.gsub('%','%').gsub('"','\"').strip + '"' |
33 | end |
34 | comments = '' |
35 | TranslationSupport.write_file("#{RADIANT_ROOT}/config/locales/en_available_tags.yml","---\nen:\n desc",comments,descriptions) |
36 | end |
37 | |
38 | desc "Syncs all translations available_tags to the English master" |
39 | task :sync_available_tags => :environment do |
40 | # All places Radiant can store locales |
41 | locale_paths = Radiant::AvailableLocales.locale_paths |
42 | # The main translation root, basically where English is kept |
43 | language_root = "#{RADIANT_ROOT}/config/locales" |
44 | words = TranslationSupport.open_available_tags("#{language_root}/en_available_tags.yml") |
45 | locale_paths.each do |path| |
46 | if path == language_root || path.match('language_pack') |
47 | Dir["#{path}/*.yml"].each do |filename| |
48 | next unless filename.match('_available_tags') |
49 | basename = File.basename(filename, '_available_tags.yml') |
50 | puts "Syncing #{basename}" |
51 | (comments, other) = TranslationSupport.open_available_tags(filename) |
52 | puts other |
53 | end |
54 | end |
55 | end |
56 | end |
57 | |
58 | end |
59 | end |