fast_gettext 0.8.1 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. checksums.yaml +4 -4
  2. data/lib/fast_gettext/cache.rb +42 -0
  3. data/lib/fast_gettext/storage.rb +28 -55
  4. data/lib/fast_gettext/version.rb +1 -1
  5. metadata +105 -73
  6. data/.gitignore +0 -2
  7. data/.travis.yml +0 -17
  8. data/Appraisals +0 -8
  9. data/CHANGELOG +0 -8
  10. data/Gemfile +0 -10
  11. data/Gemfile.lock +0 -52
  12. data/Rakefile +0 -25
  13. data/Readme.md +0 -261
  14. data/benchmark/base.rb +0 -46
  15. data/benchmark/baseline.rb +0 -5
  16. data/benchmark/fast_gettext.rb +0 -18
  17. data/benchmark/i18n_simple.rb +0 -8
  18. data/benchmark/ideal.rb +0 -24
  19. data/benchmark/locale/de.yml +0 -126
  20. data/benchmark/locale/de/LC_MESSAGES/large.mo +0 -0
  21. data/benchmark/misc/threadsave.rb +0 -21
  22. data/benchmark/namespace/fast_gettext.rb +0 -15
  23. data/benchmark/namespace/original.rb +0 -14
  24. data/benchmark/original.rb +0 -22
  25. data/examples/db/migration.rb +0 -22
  26. data/examples/missing_translation_logger.rb +0 -13
  27. data/fast_gettext.gemspec +0 -12
  28. data/gemfiles/rails23.gemfile +0 -14
  29. data/gemfiles/rails23.gemfile.lock +0 -56
  30. data/gemfiles/rails32.gemfile +0 -14
  31. data/gemfiles/rails32.gemfile.lock +0 -112
  32. data/gemfiles/rails40.gemfile +0 -15
  33. data/gemfiles/rails40.gemfile.lock +0 -110
  34. data/spec/aa_unconfigued_spec.rb +0 -21
  35. data/spec/cases/fake_load_path/iconv.rb +0 -2
  36. data/spec/cases/iconv_fallback.rb +0 -22
  37. data/spec/cases/interpolate_i18n_after_fast_gettext.rb +0 -7
  38. data/spec/cases/interpolate_i18n_before_fast_gettext.rb +0 -9
  39. data/spec/cases/safe_mode_can_handle_locales.rb +0 -5
  40. data/spec/fast_gettext/mo_file_spec.rb +0 -35
  41. data/spec/fast_gettext/po_file_spec.rb +0 -35
  42. data/spec/fast_gettext/storage_spec.rb +0 -386
  43. data/spec/fast_gettext/translation_repository/base_spec.rb +0 -24
  44. data/spec/fast_gettext/translation_repository/chain_spec.rb +0 -98
  45. data/spec/fast_gettext/translation_repository/db_spec.rb +0 -114
  46. data/spec/fast_gettext/translation_repository/logger_spec.rb +0 -40
  47. data/spec/fast_gettext/translation_repository/mo_spec.rb +0 -58
  48. data/spec/fast_gettext/translation_repository/po_spec.rb +0 -65
  49. data/spec/fast_gettext/translation_repository/yaml_spec.rb +0 -84
  50. data/spec/fast_gettext/translation_repository_spec.rb +0 -33
  51. data/spec/fast_gettext/translation_spec.rb +0 -363
  52. data/spec/fast_gettext/vendor/iconv_spec.rb +0 -7
  53. data/spec/fast_gettext/vendor/string_spec.rb +0 -101
  54. data/spec/fast_gettext_spec.rb +0 -51
  55. data/spec/fuzzy_locale/de/test.po +0 -22
  56. data/spec/locale/de/LC_MESSAGES/test.mo +0 -0
  57. data/spec/locale/de/LC_MESSAGES/test2.mo +0 -0
  58. data/spec/locale/de/test.po +0 -74
  59. data/spec/locale/de/test2.po +0 -64
  60. data/spec/locale/en/LC_MESSAGES/plural_test.mo +0 -0
  61. data/spec/locale/en/LC_MESSAGES/test.mo +0 -0
  62. data/spec/locale/en/plural_test.po +0 -20
  63. data/spec/locale/en/test.po +0 -59
  64. data/spec/locale/gsw_CH/LC_MESSAGES/test.mo +0 -0
  65. data/spec/locale/gsw_CH/test.po +0 -61
  66. data/spec/locale/yaml/de.yml +0 -25
  67. data/spec/locale/yaml/de2.yml +0 -25
  68. data/spec/locale/yaml/en.yml +0 -21
  69. data/spec/locale/yaml/notfound.yml +0 -2
  70. data/spec/obsolete_locale/de/test.po +0 -21
  71. data/spec/spec_helper.rb +0 -42
  72. data/spec/support/be_accessible_matcher.rb +0 -8
@@ -1,51 +0,0 @@
1
- require "spec_helper"
2
-
3
- default_setup
4
- class IncludeTest
5
- include FastGettext::Translation
6
- @@xx = _('car')
7
- def self.ext
8
- _('car')
9
- end
10
- def inc
11
- _('car')
12
- end
13
- def self.xx
14
- @@xx
15
- end
16
- end
17
-
18
- describe FastGettext do
19
- include FastGettext
20
- before :all do
21
- default_setup
22
- end
23
-
24
- it "provides access to FastGettext::Translations methods" do
25
- FastGettext._('car').should == 'Auto'
26
- _('car').should == 'Auto'
27
- _("%{relative_time} ago").should == "vor %{relative_time}"
28
- (_("%{relative_time} ago") % {:relative_time => 1}).should == "vor 1"
29
- (N_("%{relative_time} ago") % {:relative_time => 1}).should == "1 ago"
30
- s_("XXX|not found").should == "not found"
31
- n_('Axis','Axis',1).should == 'Achse'
32
- N_('XXXXX').should == 'XXXXX'
33
- Nn_('X','Y').should == ['X','Y']
34
- end
35
-
36
- it "is extended to a class and included into a class" do
37
- IncludeTest.ext.should == 'Auto'
38
- IncludeTest.ext.should == 'Auto'
39
- IncludeTest.new.inc.should == 'Auto'
40
- IncludeTest.xx.should == 'Auto'
41
- end
42
-
43
- it "loads 3-letter locales as well" do
44
- FastGettext.locale = 'gsw_CH'
45
- FastGettext._('Car was successfully created.').should == "Z auto isch erfolgriich gspeicharat worda."
46
- end
47
-
48
- it "has a VERSION" do
49
- FastGettext::VERSION.should =~ /^\d+\.\d+\.\d+$/
50
- end
51
- end
@@ -1,22 +0,0 @@
1
- # SOME DESCRIPTIVE TITLE.
2
- # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3
- # This file is distributed under the same license as the PACKAGE package.
4
- # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5
- #
6
- #, fuzzy
7
- msgid ""
8
- msgstr ""
9
- "Project-Id-Version: version 0.0.1\n"
10
- "POT-Creation-Date: 2009-02-26 19:50+0100\n"
11
- "PO-Revision-Date: 2009-02-18 14:53+0100\n"
12
- "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
- "Language-Team: LANGUAGE <LL@li.org>\n"
14
- "MIME-Version: 1.0\n"
15
- "Content-Type: text/plain; charset=UTF-8\n"
16
- "Content-Transfer-Encoding: 8bit\n"
17
- "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
18
-
19
- #: app/helpers/translation_helper.rb:3
20
- # fuzzy
21
- msgid "%{relative_time} ago"
22
- msgstr "vor %{relative_time}"
Binary file
Binary file
@@ -1,74 +0,0 @@
1
- # SOME DESCRIPTIVE TITLE.
2
- # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3
- # This file is distributed under the same license as the PACKAGE package.
4
- # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5
- #
6
- #, fuzzy
7
- msgid ""
8
- msgstr ""
9
- "Project-Id-Version: version 0.0.1\n"
10
- "POT-Creation-Date: 2009-02-26 19:50+0100\n"
11
- "PO-Revision-Date: 2011-12-04 18:54+0900\n"
12
- "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
- "Language-Team: LANGUAGE <LL@li.org>\n"
14
- "MIME-Version: 1.0\n"
15
- "Content-Type: text/plain; charset=UTF-8\n"
16
- "Content-Transfer-Encoding: 8bit\n"
17
- "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
18
-
19
- #: app/helpers/translation_helper.rb:3
20
- msgid "%{relative_time} ago"
21
- msgstr "vor %{relative_time}"
22
-
23
- #: app/views/cars/show.html.erb:5
24
- msgid "Axis"
25
- msgid_plural "Axis"
26
- msgstr[0] "Achse"
27
- msgstr[1] "Achsen"
28
-
29
- #: app/controllers/cars_controller.rb:47
30
- msgid "Car was successfully created."
31
- msgstr "Auto wurde erfolgreich gespeichert"
32
-
33
- #: app/controllers/cars_controller.rb:64
34
- msgid "Car was successfully updated."
35
- msgstr "Auto wurde erfolgreich aktualisiert"
36
-
37
- #: app/views/cars/show.html.erb:1 locale/model_attributes.rb:3
38
- msgid "Car|Model"
39
- msgstr "Modell"
40
-
41
- msgid "Untranslated"
42
- msgstr ""
43
-
44
- msgid "Untranslated and translated in test2"
45
- msgstr ""
46
-
47
- #: app/views/cars/show.html.erb:3 locale/model_attributes.rb:4
48
- msgid "Car|Wheels count"
49
- msgstr "Räderzahl"
50
-
51
- #: app/views/cars/show.html.erb:7
52
- msgid "Created"
53
- msgstr "Erstellt"
54
-
55
- #: app/views/cars/show.html.erb:9
56
- msgid "Month"
57
- msgstr "Monat"
58
-
59
- #: locale/model_attributes.rb:2
60
- msgid "car"
61
- msgstr "Auto"
62
-
63
- #: locale/testlog_phrases.rb:2
64
- msgid "this is a dynamic translation which was found thorugh gettext_test_log!"
65
- msgstr ""
66
- "Dies ist eine dynamische Übersetzung, die durch gettext_test_log "
67
- "gefunden wurde!"
68
-
69
- #: locale/test_escape.rb:2
70
- msgid "You should escape '\\' as '\\\\'."
71
- msgstr "Du solltest '\\' als '\\\\' escapen."
72
-
73
- msgid "Umläüte"
74
- msgstr "Umlaute"
@@ -1,64 +0,0 @@
1
- # this is the same file as test.po but with "2" added to each translation
2
- # and one extra translation added
3
-
4
- #, fuzzy
5
- msgid ""
6
- msgstr ""
7
- "Project-Id-Version: version 0.0.1\n"
8
- "POT-Creation-Date: 2009-02-26 19:50+0100\n"
9
- "PO-Revision-Date: 2011-12-04 18:54+0900\n"
10
- "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
11
- "Language-Team: LANGUAGE <LL@li.org>\n"
12
- "MIME-Version: 1.0\n"
13
- "Content-Type: text/plain; charset=UTF-8\n"
14
- "Content-Transfer-Encoding: 8bit\n"
15
- "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
16
-
17
- msgid "%{relative_time} ago"
18
- msgstr "vor %{relative_time} 2"
19
-
20
- msgid "Axis"
21
- msgid_plural "Axis 2"
22
- msgstr[0] "Achse 2"
23
- msgstr[1] "Achsen 2"
24
-
25
- msgid "Car was successfully created."
26
- msgstr "Auto wurde erfolgreich gespeichert 2"
27
-
28
- msgid "Car was successfully updated."
29
- msgstr "Auto wurde erfolgreich aktualisiert 2"
30
-
31
- msgid "Car|Model"
32
- msgstr "Modell 2"
33
-
34
- msgid "Untranslated"
35
- msgstr ""
36
-
37
- msgid "Untranslated and translated in test2"
38
- msgstr "Translated"
39
-
40
- msgid "Car|Wheels count"
41
- msgstr "Räderzahl 2"
42
-
43
- msgid "Created"
44
- msgstr "Erstellt 2"
45
-
46
- msgid "Month"
47
- msgstr "Monat 2"
48
-
49
- msgid "car"
50
- msgstr "Auto 2"
51
-
52
- msgid "this is a dynamic translation which was found thorugh gettext_test_log!"
53
- msgstr ""
54
- "Dies ist eine dynamische Übersetzung, die durch gettext_test_log "
55
- "gefunden wurde! 2"
56
-
57
- msgid "You should escape '\\' as '\\\\'."
58
- msgstr "Du solltest '\\' als '\\\\' escapen. 2"
59
-
60
- msgid "Umläüte"
61
- msgstr "Umlaute 2"
62
-
63
- msgid "only in test2 domain"
64
- msgstr "nur in test2 Domain"
Binary file
@@ -1,20 +0,0 @@
1
- # SOME DESCRIPTIVE TITLE.
2
- # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3
- # This file is distributed under the same license as the PACKAGE package.
4
- # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5
- #
6
- #, fuzzy
7
- msgid ""
8
- msgstr ""
9
- "Project-Id-Version: version 0.0.1\n"
10
- "POT-Creation-Date: 2009-02-26 19:50+0100\n"
11
- "PO-Revision-Date: 2009-02-18 15:42+0100\n"
12
- "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
- "Language-Team: LANGUAGE <LL@li.org>\n"
14
- "MIME-Version: 1.0\n"
15
- "Content-Type: text/plain; charset=UTF-8\n"
16
- "Content-Transfer-Encoding: 8bit\n"
17
- "Plural-Forms: nplurals=2; plural=n==2?3:4;\n"
18
-
19
- msgid "car"
20
- msgstr "Test"
@@ -1,59 +0,0 @@
1
- # SOME DESCRIPTIVE TITLE.
2
- # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3
- # This file is distributed under the same license as the PACKAGE package.
4
- # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5
- #
6
- #, fuzzy
7
- msgid ""
8
- msgstr ""
9
- "Project-Id-Version: version 0.0.1\n"
10
- "POT-Creation-Date: 2009-02-26 19:50+0100\n"
11
- "PO-Revision-Date: 2009-02-18 15:42+0100\n"
12
- "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
- "Language-Team: LANGUAGE <LL@li.org>\n"
14
- "MIME-Version: 1.0\n"
15
- "Content-Type: text/plain; charset=UTF-8\n"
16
- "Content-Transfer-Encoding: 8bit\n"
17
- "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
18
-
19
- #: app/helpers/translation_helper.rb:3
20
- msgid "%{relative_time} ago"
21
- msgstr ""
22
-
23
- #: app/views/cars/show.html.erb:5
24
- msgid "Axis"
25
- msgid_plural "Axis"
26
- msgstr[0] ""
27
- msgstr[1] ""
28
-
29
- #: app/controllers/cars_controller.rb:47
30
- msgid "Car was successfully created."
31
- msgstr ""
32
-
33
- #: app/controllers/cars_controller.rb:64
34
- msgid "Car was successfully updated."
35
- msgstr ""
36
-
37
- #: app/views/cars/show.html.erb:1 locale/model_attributes.rb:3
38
- msgid "Car|Model"
39
- msgstr ""
40
-
41
- #: app/views/cars/show.html.erb:3 locale/model_attributes.rb:4
42
- msgid "Car|Wheels count"
43
- msgstr ""
44
-
45
- #: app/views/cars/show.html.erb:7
46
- msgid "Created"
47
- msgstr ""
48
-
49
- #: app/views/cars/show.html.erb:9
50
- msgid "Month"
51
- msgstr ""
52
-
53
- #: locale/model_attributes.rb:2
54
- msgid "car"
55
- msgstr ""
56
-
57
- #: locale/testlog_phrases.rb:2
58
- msgid "this is a dynamic translation which was found thorugh gettext_test_log!"
59
- msgstr ""
Binary file
@@ -1,61 +0,0 @@
1
- # SOME DESCRIPTIVE TITLE.
2
- # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3
- # This file is distributed under the same license as the PACKAGE package.
4
- # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5
- #
6
- msgid ""
7
- msgstr ""
8
- "Project-Id-Version: version 0.0.1\n"
9
- "POT-Creation-Date: 2009-02-26 19:50+0100\n"
10
- "PO-Revision-Date: 2011-06-17 14:09+0100\n"
11
- "Last-Translator: Ramón Cahenzli <rca@psy-q.ch>\n"
12
- "Language-Team: LANGUAGE <LL@li.org>\n"
13
- "MIME-Version: 1.0\n"
14
- "Content-Type: text/plain; charset=UTF-8\n"
15
- "Content-Transfer-Encoding: 8bit\n"
16
- "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
17
-
18
- #: app/helpers/translation_helper.rb:3
19
- msgid "%{relative_time} ago"
20
- msgstr "vor %{relative_time}"
21
-
22
- #: app/views/cars/show.html.erb:5
23
- msgid "Axis"
24
- msgid_plural "Axis"
25
- msgstr[0] "Achsa"
26
- msgstr[1] "Achsana"
27
-
28
- #: app/controllers/cars_controller.rb:47
29
- msgid "Car was successfully created."
30
- msgstr "Z auto isch erfolgriich gspeicharat worda."
31
-
32
- #: app/controllers/cars_controller.rb:64
33
- msgid "Car was successfully updated."
34
- msgstr "Z auto isch erfolgriich aktualisiart worda."
35
-
36
- #: app/views/cars/show.html.erb:1
37
- #: locale/model_attributes.rb:3
38
- msgid "Car|Model"
39
- msgstr "Modell"
40
-
41
- #: app/views/cars/show.html.erb:3
42
- #: locale/model_attributes.rb:4
43
- msgid "Car|Wheels count"
44
- msgstr "Räderzahl"
45
-
46
- #: app/views/cars/show.html.erb:7
47
- msgid "Created"
48
- msgstr "Erstellt"
49
-
50
- #: app/views/cars/show.html.erb:9
51
- msgid "Month"
52
- msgstr "Monat"
53
-
54
- #: locale/model_attributes.rb:2
55
- msgid "car"
56
- msgstr "Auto"
57
-
58
- #: locale/testlog_phrases.rb:2
59
- msgid "this is a dynamic translation which was found thorugh gettext_test_log!"
60
- msgstr "Das isch a dynamischi übersetzig, wo dur gettext_test_log gfunda worda isch!"
61
-
@@ -1,25 +0,0 @@
1
- de:
2
- simple: einfach
3
- date:
4
- relative: "vor %{relative_time}"
5
-
6
- cars:
7
- axis:
8
- one: "Achse"
9
- other: "Achsen"
10
- silly:
11
- one: '0'
12
- other: '1'
13
- plural2: '2'
14
- plural3: '3'
15
- model: "Modell"
16
- wheel_count: "Räderzahl"
17
- created: "Erstellt"
18
- month: "Monat"
19
- car: "Auto"
20
- messages:
21
- created: "Auto wurde erfolgreich gespeichert"
22
- updated: "Auto wurde erfolgreich aktualisiert"
23
-
24
- test_log:
25
- phrases: "Dies ist eine dynamische Übersetzung, die durch gettext_test_log gefunden wurde!"
@@ -1,25 +0,0 @@
1
- de:
2
- simple: einfach
3
- date:
4
- relative: "vor %{relative_time}"
5
-
6
- cars:
7
- axis:
8
- one: "Achse"
9
- other: "Achsen"
10
- silly:
11
- one: '0'
12
- other: '1'
13
- plural2: '2'
14
- plural3: '3'
15
- model: "Modell"
16
- wheel_count: "Räderzahl"
17
- created: "Erstellt"
18
- month: "Monat"
19
- car: "Aufzugskabine"
20
- messages:
21
- created: "Auto wurde erfolgreich gespeichert"
22
- updated: "Auto wurde erfolgreich aktualisiert"
23
-
24
- test_log:
25
- phrases: "Dies ist eine dynamische Übersetzung, die durch gettext_test_log gefunden wurde!"
@@ -1,21 +0,0 @@
1
- en:
2
- pluralisation_rule: n<3?n:0
3
- simple: easy
4
- date:
5
- relative: "%{relative_time} ago"
6
-
7
- cars:
8
- axis:
9
- one: "Axis"
10
- other: "Axis"
11
- model: "Model"
12
- wheel_count: "Wheels count"
13
- created: "Created"
14
- month: "Month"
15
- car: "Car"
16
- messages:
17
- created: "Car was successfully created."
18
- updated: "Car was successfully updated."
19
-
20
- test_log:
21
- phrases: "this is a dynamic translation which was found thorugh gettext_test_log!"