refinerycms-i18n 0.9.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. data/REFINERY_README +8 -0
  2. data/Rakefile +34 -0
  3. data/config/locales/ar.yml +121 -0
  4. data/config/locales/bg.yml +198 -0
  5. data/config/locales/bn-IN.yml +180 -0
  6. data/config/locales/bs.yml +114 -0
  7. data/config/locales/ca-ES.yml +155 -0
  8. data/config/locales/cz.rb +166 -0
  9. data/config/locales/da.yml +167 -0
  10. data/config/locales/de-AT.yml +140 -0
  11. data/config/locales/de.yml +141 -0
  12. data/config/locales/dsb.yml +182 -0
  13. data/config/locales/el.yml +191 -0
  14. data/config/locales/es-AR.yml +168 -0
  15. data/config/locales/es-CO.yml +146 -0
  16. data/config/locales/es-MX.yml +118 -0
  17. data/config/locales/es.yml +186 -0
  18. data/config/locales/et.yml +109 -0
  19. data/config/locales/fa.yml +119 -0
  20. data/config/locales/fi.yml +154 -0
  21. data/config/locales/fr-CH.yml +123 -0
  22. data/config/locales/fr.yml +140 -0
  23. data/config/locales/fun/en-AU.rb +105 -0
  24. data/config/locales/fun/gibberish.rb +109 -0
  25. data/config/locales/fur.yml +141 -0
  26. data/config/locales/gl-ES.yml +193 -0
  27. data/config/locales/he.yml +103 -0
  28. data/config/locales/hr.yml +116 -0
  29. data/config/locales/hsb.yml +190 -0
  30. data/config/locales/hu.yml +144 -0
  31. data/config/locales/id.yml +122 -0
  32. data/config/locales/is.yml +142 -0
  33. data/config/locales/it.yml +146 -0
  34. data/config/locales/ja.yml +139 -0
  35. data/config/locales/ko.yml +153 -0
  36. data/config/locales/lo.yml +201 -0
  37. data/config/locales/lt.yml +141 -0
  38. data/config/locales/lv.yml +132 -0
  39. data/config/locales/mk.yml +115 -0
  40. data/config/locales/nb.yml +103 -0
  41. data/config/locales/nl.yml +173 -0
  42. data/config/locales/nn.yml +96 -0
  43. data/config/locales/pl.yml +127 -0
  44. data/config/locales/pt-BR.yml +148 -0
  45. data/config/locales/pt-PT.yml +220 -0
  46. data/config/locales/rm.yml +134 -0
  47. data/config/locales/ro.yml +152 -0
  48. data/config/locales/ru.yml +210 -0
  49. data/config/locales/sk.yml +139 -0
  50. data/config/locales/sl.yml +190 -0
  51. data/config/locales/sr-Latn.yml +116 -0
  52. data/config/locales/sr.yml +116 -0
  53. data/config/locales/sv-SE.yml +191 -0
  54. data/config/locales/sw.yml +123 -0
  55. data/config/locales/th.rb +222 -0
  56. data/config/locales/tr.yml +139 -0
  57. data/config/locales/uk.yml +237 -0
  58. data/config/locales/vi.yml +198 -0
  59. data/config/locales/zh-CN.yml +131 -0
  60. data/config/locales/zh-TW.yml +132 -0
  61. data/i18n-js-readme.rdoc +249 -0
  62. data/lib/gemspec.rb +29 -0
  63. data/lib/refinery/i18n-filter.rb +38 -0
  64. data/lib/refinery/i18n-js.rb +132 -0
  65. data/lib/refinery/i18n-js.yml +4 -0
  66. data/lib/refinery/i18n.js +339 -0
  67. data/lib/refinery/i18n.rb +146 -0
  68. data/lib/refinery/translate.rb +13 -0
  69. data/lib/tasks/i18n-js_tasks.rake +16 -0
  70. data/lib/tasks/translate.rake +200 -0
  71. data/lib/translate/file.rb +35 -0
  72. data/lib/translate/keys.rb +123 -0
  73. data/lib/translate/log.rb +39 -0
  74. data/lib/translate/storage.rb +20 -0
  75. data/test/i18n-test.html +50 -0
  76. data/test/i18n-test.js +661 -0
  77. data/test/i18n_js_test.rb +168 -0
  78. data/test/jsunittest/jsunittest.js +1017 -0
  79. data/test/jsunittest/unittest.css +54 -0
  80. data/test/resources/custom_path.yml +4 -0
  81. data/test/resources/default.yml +4 -0
  82. data/test/resources/locales.yml +76 -0
  83. data/test/resources/multiple_files.yml +6 -0
  84. data/test/resources/no_scope.yml +3 -0
  85. data/test/resources/simple_scope.yml +4 -0
  86. data/test/test_helper.rb +24 -0
  87. data/translate-readme.md +61 -0
  88. metadata +154 -0
@@ -0,0 +1,54 @@
1
+ body, div, p, h1, h2, h3, ul, ol, span, a, table, td, form, img, li {
2
+ font-family: sans-serif;
3
+ }
4
+
5
+ body {
6
+ font-size:0.8em;
7
+ }
8
+
9
+ #log {
10
+ padding-bottom: 1em;
11
+ border-bottom: 2px solid #000;
12
+ margin-bottom: 2em;
13
+ }
14
+
15
+ .logsummary {
16
+ margin-top: 1em;
17
+ margin-bottom: 1em;
18
+ padding: 1ex;
19
+ border: 1px solid #000;
20
+ font-weight: bold;
21
+ }
22
+
23
+ .logtable {
24
+ width:100%;
25
+ border-collapse: collapse;
26
+ border: 1px dotted #666;
27
+ }
28
+
29
+ .logtable td, .logtable th {
30
+ text-align: left;
31
+ padding: 3px 8px;
32
+ border: 1px dotted #666;
33
+ }
34
+
35
+ .logtable .passed {
36
+ background-color: #cfc;
37
+ }
38
+
39
+ .logtable .failed, .logtable .error {
40
+ background-color: #fcc;
41
+ }
42
+
43
+ .logtable .warning {
44
+ background-color: #FC6;
45
+ }
46
+
47
+ .logtable td div.action_buttons {
48
+ display: inline;
49
+ }
50
+
51
+ .logtable td div.action_buttons input {
52
+ margin: 0 5px;
53
+ font-size: 10px;
54
+ }
@@ -0,0 +1,4 @@
1
+ # Find more details about this configuration file at http://github.com/fnando/i18n-js
2
+ translations:
3
+ - file: "public/javascripts/translations/all.js"
4
+ only: "*"
@@ -0,0 +1,4 @@
1
+ # Find more details about this configuration file at http://github.com/fnando/i18n-js
2
+ translations:
3
+ - file: "public/javascripts/translations.js"
4
+ only: "*"
@@ -0,0 +1,76 @@
1
+ en:
2
+ number:
3
+ format:
4
+ separator: "."
5
+ delimiter: ","
6
+ precision: 3
7
+ currency:
8
+ format:
9
+ format: "%u%n"
10
+ unit: "$"
11
+ separator: "."
12
+ delimiter: ","
13
+ precision: 2
14
+ date:
15
+ formats:
16
+ default: "%Y-%m-%d"
17
+ short: "%b %d"
18
+ long: "%B %d, %Y"
19
+ day_names: [Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday]
20
+ abbr_day_names: [Sun, Mon, Tue, Wed, Thu, Fri, Sat]
21
+ month_names: [~, January, February, March, April, May, June, July, August, September, October, November, December]
22
+ abbr_month_names: [~, Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec]
23
+ order: [ :year, :month, :day ]
24
+ time:
25
+ formats:
26
+ default: "%a, %d %b %Y %H:%M:%S %z"
27
+ short: "%d %b %H:%M"
28
+ long: "%B %d, %Y %H:%M"
29
+ am: "am"
30
+ pm: "pm"
31
+ admin:
32
+ show:
33
+ title: "Show"
34
+ note: "more details"
35
+ edit:
36
+ title: "Edit"
37
+
38
+ fr:
39
+ date:
40
+ formats:
41
+ default: "%d/%m/%Y"
42
+ short: "%e %b"
43
+ long: "%e %B %Y"
44
+ long_ordinal: "%e %B %Y"
45
+ only_day: "%e"
46
+ day_names: [dimanche, lundi, mardi, mercredi, jeudi, vendredi, samedi]
47
+ abbr_day_names: [dim, lun, mar, mer, jeu, ven, sam]
48
+ month_names: [~, janvier, février, mars, avril, mai, juin, juillet, août, septembre, octobre, novembre, décembre]
49
+ abbr_month_names: [~, jan., fév., mar., avr., mai, juin, juil., août, sept., oct., nov., déc.]
50
+ order: [ :day, :month, :year ]
51
+ time:
52
+ formats:
53
+ default: "%d %B %Y %H:%M"
54
+ time: "%H:%M"
55
+ short: "%d %b %H:%M"
56
+ long: "%A %d %B %Y %H:%M:%S %Z"
57
+ long_ordinal: "%A %d %B %Y %H:%M:%S %Z"
58
+ only_second: "%S"
59
+ am: 'am'
60
+ pm: 'pm'
61
+ number:
62
+ format:
63
+ precision: 3
64
+ separator: ','
65
+ delimiter: ' '
66
+ currency:
67
+ format:
68
+ unit: '€'
69
+ precision: 2
70
+ format: '%n %u'
71
+ admin:
72
+ show:
73
+ title: "Visualiser"
74
+ note: "plus de détails"
75
+ edit:
76
+ title: "Editer"
@@ -0,0 +1,6 @@
1
+ # Find more details about this configuration file at http://github.com/fnando/i18n-js
2
+ translations:
3
+ - file: "public/javascripts/all.js"
4
+ only: "*"
5
+ - file: "public/javascripts/tudo.js"
6
+ only: "*"
@@ -0,0 +1,3 @@
1
+ # Find more details about this configuration file at http://github.com/fnando/i18n-js
2
+ translations:
3
+ - file: "public/javascripts/no_scope.js"
@@ -0,0 +1,4 @@
1
+ # Find more details about this configuration file at http://github.com/fnando/i18n-js
2
+ translations:
3
+ - file: "public/javascripts/simple_scope.js"
4
+ only: "*.date.formats"
@@ -0,0 +1,24 @@
1
+ require "rubygems"
2
+ require "test/unit"
3
+ require "mocha"
4
+
5
+ begin
6
+ require "active_support/all"
7
+ rescue LoadError
8
+ require "active_support"
9
+ end
10
+
11
+ require "active_support/test_case"
12
+ require "ostruct"
13
+ require "pathname"
14
+ require "i18n"
15
+ require "json"
16
+ require "fakeweb"
17
+
18
+ FakeWeb.allow_net_connect = false
19
+
20
+ # Stub Rails.root, so we don"t need to load the whole Rails environment.
21
+ # Be careful! The specified folder will be removed!
22
+ Rails = OpenStruct.new(:root => Pathname.new(File.dirname(__FILE__) + "/tmp"))
23
+
24
+ require File.dirname(__FILE__) + "/../lib/i18n-js"
@@ -0,0 +1,61 @@
1
+ Translate
2
+ =========
3
+
4
+ This plugin provides a web interface for translating Rails I18n texts (requires Rails 2.2 or higher) from one locale to another. The plugin has been tested only with the simple I18n backend that ships with Rails. I18n texts are read from and written to YAML files under config/locales.
5
+
6
+ To translate to a new locale you need to add a YAML file for that locale that contains the locale as the top key and at least one translation.
7
+
8
+ Please note that there are certain I18n keys that map to Array objects rather than strings and those are currently not dealt with by the translation UI. This means that Rails built in keys such as date.day_names need to be translated manually directly in the YAML file.
9
+
10
+ To get the translation UI to write the YAML files in UTF8 you need to install the ya2yaml gem.
11
+
12
+ The translation UI finds all I18n keys by extracting them from I18n lookups in your application source code. In addition it adds all :en and default locale keys from the I18n backend.
13
+
14
+ - Updated: Each string in the UI now has an "Auto Translate" link which will send the original text to Google Translate and will input the returned translation into the form field for further clean up and review prior to saving.
15
+
16
+
17
+ Rake Tasks
18
+ =========
19
+
20
+ In addition to the web UI this plugin adds the following rake tasks:
21
+
22
+ translate:lost_in_translation
23
+ translate:merge_keys
24
+ translate:google
25
+ translate:changed
26
+
27
+ The lost_in_translation task shows you any I18n keys in your code that are do not have translations in the YAML file for your default locale, i.e. config/locales/sv.yml.
28
+
29
+ The merge_keys task is supposed to be used in conjunction with Sven Fuch's Rails I18n TextMate bundle (http://github.com/svenfuchs/rails-i18n/tree/master). Texts and keys extracted with the TextMate bundle end up in the temporary file log/translations.yml. When you run the merge_keys rake task the keys are moved over to the corresponding I18n locale file, i.e. config/locales/sv.yml. The merge_keys task also checks for overwrites of existing keys by warning you that one of your extracted keys already exists with a different translation.
30
+
31
+ The google task is used for auto translating from one locale to another using Google Translate.
32
+
33
+ The changed rake task can show you between one YAML file to another which keys have had their texts changed.
34
+
35
+ Installation
36
+ =========
37
+ Obtain the source with:
38
+
39
+ ./script/plugin install git://github.com/newsdesk/translate.git
40
+
41
+ To mount the plugin, add the following to your config/routes.rb file:
42
+
43
+ Translate::Routes.translation_ui(map) if RAILS_ENV != "production"
44
+
45
+ Now visit /translate in your web browser to start translating.
46
+
47
+ Dependencies
48
+ =========
49
+
50
+ - Rails 2.2 or higher
51
+ - The ya2yaml gem if you want your YAML files written in UTF8 encoding.
52
+
53
+ Authors
54
+ =========
55
+
56
+ - Peter Marklund (programming)
57
+ - Joakim Westerlund (web design)
58
+
59
+ Many thanks to http://newsdesk.se for sponsoring the development of this plugin.
60
+
61
+ Copyright (c) 2009 Peter Marklund, released under the MIT license
metadata ADDED
@@ -0,0 +1,154 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: refinerycms-i18n
3
+ version: !ruby/object:Gem::Version
4
+ hash: 43
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 9
9
+ - 8
10
+ version: 0.9.8
11
+ platform: ruby
12
+ authors:
13
+ - Resolve Digital
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2010-08-27 00:00:00 +12:00
19
+ default_executable:
20
+ dependencies: []
21
+
22
+ description: i18n logic extracted from RefineryCMS, for Refinery CMS.
23
+ email: info@refinerycms.com
24
+ executables: []
25
+
26
+ extensions: []
27
+
28
+ extra_rdoc_files: []
29
+
30
+ files:
31
+ - config/locales/ar.yml
32
+ - config/locales/bg.yml
33
+ - config/locales/bn-IN.yml
34
+ - config/locales/bs.yml
35
+ - config/locales/ca-ES.yml
36
+ - config/locales/cz.rb
37
+ - config/locales/da.yml
38
+ - config/locales/de-AT.yml
39
+ - config/locales/de.yml
40
+ - config/locales/dsb.yml
41
+ - config/locales/el.yml
42
+ - config/locales/es-AR.yml
43
+ - config/locales/es-CO.yml
44
+ - config/locales/es-MX.yml
45
+ - config/locales/es.yml
46
+ - config/locales/et.yml
47
+ - config/locales/fa.yml
48
+ - config/locales/fi.yml
49
+ - config/locales/fr-CH.yml
50
+ - config/locales/fr.yml
51
+ - config/locales/fun/en-AU.rb
52
+ - config/locales/fun/gibberish.rb
53
+ - config/locales/fur.yml
54
+ - config/locales/gl-ES.yml
55
+ - config/locales/he.yml
56
+ - config/locales/hr.yml
57
+ - config/locales/hsb.yml
58
+ - config/locales/hu.yml
59
+ - config/locales/id.yml
60
+ - config/locales/is.yml
61
+ - config/locales/it.yml
62
+ - config/locales/ja.yml
63
+ - config/locales/ko.yml
64
+ - config/locales/lo.yml
65
+ - config/locales/lt.yml
66
+ - config/locales/lv.yml
67
+ - config/locales/mk.yml
68
+ - config/locales/nb.yml
69
+ - config/locales/nl.yml
70
+ - config/locales/nn.yml
71
+ - config/locales/pl.yml
72
+ - config/locales/pt-BR.yml
73
+ - config/locales/pt-PT.yml
74
+ - config/locales/rm.yml
75
+ - config/locales/ro.yml
76
+ - config/locales/ru.yml
77
+ - config/locales/sk.yml
78
+ - config/locales/sl.yml
79
+ - config/locales/sr-Latn.yml
80
+ - config/locales/sr.yml
81
+ - config/locales/sv-SE.yml
82
+ - config/locales/sw.yml
83
+ - config/locales/th.rb
84
+ - config/locales/tr.yml
85
+ - config/locales/uk.yml
86
+ - config/locales/vi.yml
87
+ - config/locales/zh-CN.yml
88
+ - config/locales/zh-TW.yml
89
+ - i18n-js-readme.rdoc
90
+ - lib/gemspec.rb
91
+ - lib/refinery/i18n-filter.rb
92
+ - lib/refinery/i18n-js.rb
93
+ - lib/refinery/i18n-js.yml
94
+ - lib/refinery/i18n.js
95
+ - lib/refinery/i18n.rb
96
+ - lib/refinery/translate.rb
97
+ - lib/tasks/i18n-js_tasks.rake
98
+ - lib/tasks/translate.rake
99
+ - lib/translate/file.rb
100
+ - lib/translate/keys.rb
101
+ - lib/translate/log.rb
102
+ - lib/translate/storage.rb
103
+ - Rakefile
104
+ - REFINERY_README
105
+ - test/i18n-test.html
106
+ - test/i18n-test.js
107
+ - test/i18n_js_test.rb
108
+ - test/jsunittest/jsunittest.js
109
+ - test/jsunittest/unittest.css
110
+ - test/resources/custom_path.yml
111
+ - test/resources/default.yml
112
+ - test/resources/locales.yml
113
+ - test/resources/multiple_files.yml
114
+ - test/resources/no_scope.yml
115
+ - test/resources/simple_scope.yml
116
+ - test/test_helper.rb
117
+ - translate-readme.md
118
+ has_rdoc: true
119
+ homepage: http://refinerycms.com
120
+ licenses: []
121
+
122
+ post_install_message:
123
+ rdoc_options: []
124
+
125
+ require_paths:
126
+ - lib
127
+ required_ruby_version: !ruby/object:Gem::Requirement
128
+ none: false
129
+ requirements:
130
+ - - ">="
131
+ - !ruby/object:Gem::Version
132
+ hash: 3
133
+ segments:
134
+ - 0
135
+ version: "0"
136
+ required_rubygems_version: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ">="
140
+ - !ruby/object:Gem::Version
141
+ hash: 3
142
+ segments:
143
+ - 0
144
+ version: "0"
145
+ requirements: []
146
+
147
+ rubyforge_project:
148
+ rubygems_version: 1.3.7
149
+ signing_key:
150
+ specification_version: 3
151
+ summary: i18n logic for Refinery CMS.
152
+ test_files:
153
+ - test/i18n_js_test.rb
154
+ - test/test_helper.rb