r18n-desktop 0.1

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE ADDED
@@ -0,0 +1,166 @@
1
+ GNU LESSER GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+
9
+ This version of the GNU Lesser General Public License incorporates
10
+ the terms and conditions of version 3 of the GNU General Public
11
+ License, supplemented by the additional permissions listed below.
12
+
13
+ 0. Additional Definitions.
14
+
15
+ As used herein, "this License" refers to version 3 of the GNU Lesser
16
+ General Public License, and the "GNU GPL" refers to version 3 of the GNU
17
+ General Public License.
18
+
19
+ "The Library" refers to a covered work governed by this License,
20
+ other than an Application or a Combined Work as defined below.
21
+
22
+ An "Application" is any work that makes use of an interface provided
23
+ by the Library, but which is not otherwise based on the Library.
24
+ Defining a subclass of a class defined by the Library is deemed a mode
25
+ of using an interface provided by the Library.
26
+
27
+ A "Combined Work" is a work produced by combining or linking an
28
+ Application with the Library. The particular version of the Library
29
+ with which the Combined Work was made is also called the "Linked
30
+ Version".
31
+
32
+ The "Minimal Corresponding Source" for a Combined Work means the
33
+ Corresponding Source for the Combined Work, excluding any source code
34
+ for portions of the Combined Work that, considered in isolation, are
35
+ based on the Application, and not on the Linked Version.
36
+
37
+ The "Corresponding Application Code" for a Combined Work means the
38
+ object code and/or source code for the Application, including any data
39
+ and utility programs needed for reproducing the Combined Work from the
40
+ Application, but excluding the System Libraries of the Combined Work.
41
+
42
+ 1. Exception to Section 3 of the GNU GPL.
43
+
44
+ You may convey a covered work under sections 3 and 4 of this License
45
+ without being bound by section 3 of the GNU GPL.
46
+
47
+ 2. Conveying Modified Versions.
48
+
49
+ If you modify a copy of the Library, and, in your modifications, a
50
+ facility refers to a function or data to be supplied by an Application
51
+ that uses the facility (other than as an argument passed when the
52
+ facility is invoked), then you may convey a copy of the modified
53
+ version:
54
+
55
+ a) under this License, provided that you make a good faith effort to
56
+ ensure that, in the event an Application does not supply the
57
+ function or data, the facility still operates, and performs
58
+ whatever part of its purpose remains meaningful, or
59
+
60
+ b) under the GNU GPL, with none of the additional permissions of
61
+ this License applicable to that copy.
62
+
63
+ 3. Object Code Incorporating Material from Library Header Files.
64
+
65
+ The object code form of an Application may incorporate material from
66
+ a header file that is part of the Library. You may convey such object
67
+ code under terms of your choice, provided that, if the incorporated
68
+ material is not limited to numerical parameters, data structure
69
+ layouts and accessors, or small macros, inline functions and templates
70
+ (ten or fewer lines in length), you do both of the following:
71
+
72
+ a) Give prominent notice with each copy of the object code that the
73
+ Library is used in it and that the Library and its use are
74
+ covered by this License.
75
+
76
+ b) Accompany the object code with a copy of the GNU GPL and this license
77
+ document.
78
+
79
+ 4. Combined Works.
80
+
81
+ You may convey a Combined Work under terms of your choice that,
82
+ taken together, effectively do not restrict modification of the
83
+ portions of the Library contained in the Combined Work and reverse
84
+ engineering for debugging such modifications, if you also do each of
85
+ the following:
86
+
87
+ a) Give prominent notice with each copy of the Combined Work that
88
+ the Library is used in it and that the Library and its use are
89
+ covered by this License.
90
+
91
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
92
+ document.
93
+
94
+ c) For a Combined Work that displays copyright notices during
95
+ execution, include the copyright notice for the Library among
96
+ these notices, as well as a reference directing the user to the
97
+ copies of the GNU GPL and this license document.
98
+
99
+ d) Do one of the following:
100
+
101
+ 0) Convey the Minimal Corresponding Source under the terms of this
102
+ License, and the Corresponding Application Code in a form
103
+ suitable for, and under terms that permit, the user to
104
+ recombine or relink the Application with a modified version of
105
+ the Linked Version to produce a modified Combined Work, in the
106
+ manner specified by section 6 of the GNU GPL for conveying
107
+ Corresponding Source.
108
+
109
+ 1) Use a suitable shared library mechanism for linking with the
110
+ Library. A suitable mechanism is one that (a) uses at run time
111
+ a copy of the Library already present on the user's computer
112
+ system, and (b) will operate properly with a modified version
113
+ of the Library that is interface-compatible with the Linked
114
+ Version.
115
+
116
+ e) Provide Installation Information, but only if you would otherwise
117
+ be required to provide such information under section 6 of the
118
+ GNU GPL, and only to the extent that such information is
119
+ necessary to install and execute a modified version of the
120
+ Combined Work produced by recombining or relinking the
121
+ Application with a modified version of the Linked Version. (If
122
+ you use option 4d0, the Installation Information must accompany
123
+ the Minimal Corresponding Source and Corresponding Application
124
+ Code. If you use option 4d1, you must provide the Installation
125
+ Information in the manner specified by section 6 of the GNU GPL
126
+ for conveying Corresponding Source.)
127
+
128
+ 5. Combined Libraries.
129
+
130
+ You may place library facilities that are a work based on the
131
+ Library side by side in a single library together with other library
132
+ facilities that are not Applications and are not covered by this
133
+ License, and convey such a combined library under terms of your
134
+ choice, if you do both of the following:
135
+
136
+ a) Accompany the combined library with a copy of the same work based
137
+ on the Library, uncombined with any other library facilities,
138
+ conveyed under the terms of this License.
139
+
140
+ b) Give prominent notice with the combined library that part of it
141
+ is a work based on the Library, and explaining where to find the
142
+ accompanying uncombined form of the same work.
143
+
144
+ 6. Revised Versions of the GNU Lesser General Public License.
145
+
146
+ The Free Software Foundation may publish revised and/or new versions
147
+ of the GNU Lesser General Public License from time to time. Such new
148
+ versions will be similar in spirit to the present version, but may
149
+ differ in detail to address new problems or concerns.
150
+
151
+ Each version is given a distinguishing version number. If the
152
+ Library as you received it specifies that a certain numbered version
153
+ of the GNU Lesser General Public License "or any later version"
154
+ applies to it, you have the option of following the terms and
155
+ conditions either of that published version or of any later version
156
+ published by the Free Software Foundation. If the Library as you
157
+ received it does not specify a version number of the GNU Lesser
158
+ General Public License, you may choose any version of the GNU Lesser
159
+ General Public License ever published by the Free Software Foundation.
160
+
161
+ If the Library as you received it specifies that a proxy can decide
162
+ whether future versions of the GNU Lesser General Public License shall
163
+ apply, that proxy's public statement of acceptance of any version is
164
+ permanent authorization for you to choose that version for the
165
+ Library.
166
+
data/README.rdoc ADDED
@@ -0,0 +1,71 @@
1
+ = R18n Desktop
2
+
3
+ A tool to translate your desktop application in several languages.
4
+
5
+ It is just a wrap for R18n core library. See R18n documentation for more
6
+ information.
7
+
8
+ == Features
9
+
10
+ * If there isn’t translation in user locale, it will be found in locales, which
11
+ user may know (not only in default locale). For example, many people in
12
+ Belarus can understand Russian, and locale has information about it.
13
+ * It can localize your application: format numbers to the rules of the user
14
+ locale, translate month and week days name and give other locale information.
15
+ * It has translation for commons words, like “OK”, “Cancel”, etc.
16
+ * It storage translation in rich YAML format. You can put procedures and
17
+ pluralization (“1 comment”, “5 comments”) in your translation.
18
+
19
+ == How To
20
+ 1. Create translations dir. For example: <tt>_YOUR_APP_/translations/</tt>.
21
+ 2. Add file with translation in some language. For example
22
+ <tt>_YOUR_APP_/translations/en.yml</tt>:
23
+
24
+ file:
25
+ add: Add file
26
+ delete: Delete file %1
27
+
28
+ files: !!pl
29
+ 0: No files
30
+ 1: One file
31
+ n: %1 files
32
+
33
+ author: !!proc |name| "This file was created by #{name.capitalize}"
34
+
35
+ 3. Add R18n to your application:
36
+
37
+ require 'rubygems'
38
+ require 'r18n-desktop'
39
+
40
+ 4. Load I18n object:
41
+
42
+ i18n = R18n.from_env 'translations/'
43
+
44
+ Or, if user can optional set locale manually:
45
+
46
+ i18n = R18n.from_env 'translations/', manual_locale
47
+
48
+ 5. Use translation messages to user. For example:
49
+
50
+ i18n.file.add #=> "Add file"
51
+ i18n.file.delete('Test') #=> "Delete file Test"
52
+ i18n.files(1) #=> "One file"
53
+ i18n.files(12) #=> "12 files"
54
+ i18n.author('user') #=> "This file was created by User"
55
+
56
+ i18n.l -12000.5 #=> "−12,000.5"
57
+
58
+ i18n.l Time.now #=> "Sun Sep 21 19:50:04 GMT 2008"
59
+ i18n.l Time.now, :date #=> "09/21/2008"
60
+ i18n.l Time.now, '%B' #=> "September"
61
+
62
+ # Base translation
63
+ i18n.ok #=> "OK"
64
+ i18n.cancel #=> "Cancel"
65
+
66
+ == License
67
+ R18n is licensed under the GNU Lesser General Public License version 3.
68
+ You can read it in LICENSE file or in http://www.gnu.org/licenses/lgpl.html.
69
+
70
+ == Author
71
+ Andrey “A.I.” Sitnik <andrey@sitnik.ru>
data/Rakefile ADDED
@@ -0,0 +1,94 @@
1
+ require 'rubygems'
2
+ require 'rake/rdoctask'
3
+ require 'rake/gempackagetask'
4
+ require 'spec/rake/spectask'
5
+
6
+ PKG_NAME = 'r18n-desktop'
7
+ PKG_VERSION = '0.1'
8
+
9
+ ##############################################################################
10
+ # Tests
11
+ ##############################################################################
12
+
13
+ desc 'Run all specs'
14
+ Spec::Rake::SpecTask.new('specs') do |t|
15
+ t.spec_opts = ['--format', 'specdoc', '--colour']
16
+ t.spec_files = Dir['spec/**/*_spec.rb'].sort
17
+ end
18
+
19
+ desc 'Run a specific spec with TASK=xxxx'
20
+ Spec::Rake::SpecTask.new('spec') do |t|
21
+ t.spec_opts = ['--format', 'specdoc', '--colour']
22
+ t.libs = ['lib']
23
+ t.spec_files = ["spec/**/#{ENV['TASK']}_spec.rb"]
24
+ end
25
+
26
+ desc 'Run all specs output html'
27
+ Spec::Rake::SpecTask.new('specs_html') do |t|
28
+ t.spec_opts = ['--format', 'html']
29
+ t.libs = ['lib']
30
+ t.spec_files = Dir['spec/**/*_spec.rb'].sort
31
+ end
32
+
33
+ desc 'RCov'
34
+ Spec::Rake::SpecTask.new('rcov') do |t|
35
+ t.spec_opts = ['--format', 'specdoc', '--colour']
36
+ t.spec_files = Dir['spec/**/*_spec.rb'].sort
37
+ t.libs = ['lib']
38
+ t.rcov = true
39
+ end
40
+
41
+ ##############################################################################
42
+ # Documentation and distribution
43
+ ##############################################################################
44
+
45
+ Rake::RDocTask.new do |rdoc|
46
+ rdoc.main = 'README.rdoc'
47
+ rdoc.rdoc_files.include('README.rdoc', 'LICENSE', 'lib/**/*.rb')
48
+ rdoc.title = 'R18n Desktop Documentation'
49
+ rdoc.rdoc_dir = 'doc'
50
+ rdoc.options << '-c utf-8'
51
+ rdoc.options << '--all'
52
+ end
53
+
54
+ spec = Gem::Specification.new do |s|
55
+ s.platform = Gem::Platform::RUBY
56
+ s.name = PKG_NAME
57
+ s.version = PKG_VERSION
58
+ s.summary = 'A tool to translate your Ruby desktop application.'
59
+ s.description = <<-EOF
60
+ A tool to translate your desktop application in several languages.
61
+ It is just a wrap for R18n core library.
62
+ It can localize your application, has translation for commons words,
63
+ storage translation in rich YAML format with pluralization and procedures
64
+ and has sublocales list for each supported locale.
65
+ EOF
66
+
67
+ s.files = FileList[
68
+ 'lib/**/*',
69
+ 'LICENSE',
70
+ 'Rakefile',
71
+ 'README.rdoc']
72
+ s.test_files = FileList[
73
+ 'spec/**/*']
74
+ s.extra_rdoc_files = ['README.rdoc', 'LICENSE']
75
+ s.require_path = 'lib'
76
+ s.has_rdoc = true
77
+
78
+ s.add_dependency 'r18n-core', '0.1'
79
+
80
+ s.author = 'Andrey "A.I." Sitnik'
81
+ s.email = 'andrey@sitnik.ru'
82
+ s.homepage = 'http://r18n.rubyforge.org/'
83
+ s.rubyforge_project = PKG_NAME
84
+ end
85
+
86
+ Rake::GemPackageTask.new(spec) do |pkg|
87
+ pkg.gem_spec = spec
88
+ end
89
+
90
+ desc 'Install as a gem'
91
+ task :install => [:package] do
92
+ sudo = RUBY_PLATFORM =~ /win32/ ? '' : 'sudo'
93
+ sh %{#{sudo} gem install pkg/#{PKG_NAME}-#{PKG_VERSION}}
94
+ end
@@ -0,0 +1,45 @@
1
+ =begin
2
+ I18n support for desktop application.
3
+
4
+ Copyright (C) 2008 Andrey “A.I.” Sitnik <andrey@sitnik.ru>
5
+
6
+ This program is free software: you can redistribute it and/or modify
7
+ it under the terms of the GNU Lesser General Public License as published by
8
+ the Free Software Foundation, either version 3 of the License, or
9
+ (at your option) any later version.
10
+
11
+ This program is distributed in the hope that it will be useful,
12
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ GNU Lesser General Public License for more details.
15
+
16
+ You should have received a copy of the GNU Lesser General Public License
17
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ =end
19
+
20
+ require 'rubygems'
21
+ gem 'r18n-core', '=0.1'
22
+ require 'r18n-core'
23
+
24
+ require 'pathname'
25
+ dir = Pathname(__FILE__).dirname.expand_path + 'r18n-desktop'
26
+ if /cygwin|mingw|win32/ =~ RUBY_PLATFORM
27
+ require dir + 'win32'
28
+ elsif /java/ =~ RUBY_PLATFORM
29
+ require dir + 'java'
30
+ else
31
+ require dir + 'posix'
32
+ end
33
+
34
+ module R18n
35
+ class << self
36
+ # Get user locale from system environment and load I18n object with locale
37
+ # information and translations from +translations_dir+. If user set locale
38
+ # +manual+ put it as last argument.
39
+ def from_env(translations_dir, manual = nil)
40
+ locales = R18n::I18n.system_locale
41
+ locales.insert(0, manual) if not manual.nil?
42
+ self.set I18n.new(locales, translations_dir)
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,26 @@
1
+ =begin
2
+ I18n support for JRuby.
3
+
4
+ Copyright (C) 2008 Andrey “A.I.” Sitnik <andrey@sitnik.ru>
5
+
6
+ This program is free software: you can redistribute it and/or modify
7
+ it under the terms of the GNU Lesser General Public License as published by
8
+ the Free Software Foundation, either version 3 of the License, or
9
+ (at your option) any later version.
10
+
11
+ This program is distributed in the hope that it will be useful,
12
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ GNU Lesser General Public License for more details.
15
+
16
+ You should have received a copy of the GNU Lesser General Public License
17
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ =end
19
+
20
+ module R18n
21
+ class I18n
22
+ def self.system_locale
23
+ java.util.Locale.getDefault.toString
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,26 @@
1
+ =begin
2
+ I18n support for UNIX-like OS.
3
+
4
+ Copyright (C) 2008 Andrey “A.I.” Sitnik <andrey@sitnik.ru>
5
+
6
+ This program is free software: you can redistribute it and/or modify
7
+ it under the terms of the GNU Lesser General Public License as published by
8
+ the Free Software Foundation, either version 3 of the License, or
9
+ (at your option) any later version.
10
+
11
+ This program is distributed in the hope that it will be useful,
12
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ GNU Lesser General Public License for more details.
15
+
16
+ You should have received a copy of the GNU Lesser General Public License
17
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ =end
19
+
20
+ module R18n
21
+ class I18n
22
+ def self.system_locale
23
+ ENV['LANG'].split('.').first.to_a
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,248 @@
1
+ =begin
2
+ I18n support for Windows.
3
+
4
+ Copyright (C) 2008 Andrey “A.I.” Sitnik <andrey@sitnik.ru>
5
+
6
+ This program is free software: you can redistribute it and/or modify
7
+ it under the terms of the GNU Lesser General Public License as published by
8
+ the Free Software Foundation, either version 3 of the License, or
9
+ (at your option) any later version.
10
+
11
+ This program is distributed in the hope that it will be useful,
12
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
13
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
+ GNU Lesser General Public License for more details.
15
+
16
+ You should have received a copy of the GNU Lesser General Public License
17
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ =end
19
+
20
+ require 'dl/win32'
21
+
22
+ module R18n
23
+ class I18n
24
+ def self.system_locale
25
+ id = Win32API.new("kernel32.dll", "GetUserDefaultLangID", nil, "i").call
26
+ WIN32_LOCALES[id]
27
+ end
28
+
29
+ WIN32_LOCALES = {
30
+ 0x0000 => 'en',
31
+ 0x007f => 'invariant',
32
+ 0x0400 => 'invalid',
33
+ 0x0800 => 'system',
34
+ 0x0436 => 'af_ZA',
35
+ 0x041c => 'sq_AL',
36
+ 0x0484 => 'gsw_FR',
37
+ 0x045e => 'am_ET',
38
+ 0x0401 => 'ar_SA',
39
+ 0x0801 => 'ar_IQ',
40
+ 0x0c01 => 'ar_EG',
41
+ 0x1001 => 'ar_LY',
42
+ 0x1401 => 'ar_DZ',
43
+ 0x1801 => 'ar_MA',
44
+ 0x1c01 => 'ar_TN',
45
+ 0x2001 => 'ar_OM',
46
+ 0x2401 => 'ar_YE',
47
+ 0x2801 => 'ar_SY',
48
+ 0x2c01 => 'ar_JO',
49
+ 0x3001 => 'ar_LB',
50
+ 0x3401 => 'ar_KW',
51
+ 0x3801 => 'ar_AE',
52
+ 0x3c01 => 'ar_BH',
53
+ 0x4001 => 'ar_QA',
54
+ 0x042b => 'hy_AM',
55
+ 0x044d => 'as_IN',
56
+ 0x042c => 'az_AZ-Latn',
57
+ 0x082c => 'az_AZ-Cyrl',
58
+ 0x046d => 'ba_RU',
59
+ 0x042d => 'eu_ES',
60
+ 0x0423 => 'be_BY',
61
+ 0x0445 => 'bn_IN',
62
+ 0x201a => 'bs_BA-Cyrl',
63
+ 0x141a => 'bs_BA-Latn',
64
+ 0x047e => 'br_FR',
65
+ 0x0402 => 'bg_BG',
66
+ 0x0455 => 'my_MM',
67
+ 0x0403 => 'ca_ES',
68
+ 0x0004 => 'zh_CHS',
69
+ 0x0404 => 'zh_TW',
70
+ 0x0804 => 'zh_CN',
71
+ 0x0c04 => 'zh_HK',
72
+ 0x1004 => 'zh_SG',
73
+ 0x1404 => 'zh_MO',
74
+ 0x7c04 => 'zh_CHT',
75
+ 0x0483 => 'co_FR',
76
+ 0x041a => 'hr_HR',
77
+ 0x101a => 'hr_BA',
78
+ 0x0405 => 'cs_CZ',
79
+ 0x0406 => 'da_DK',
80
+ 0x048c => 'gbz_AF',
81
+ 0x0465 => 'dv_MV',
82
+ 0x0413 => 'nl_NL',
83
+ 0x0813 => 'nl_BE',
84
+ 0x0409 => 'en_US',
85
+ 0x0809 => 'en_GB',
86
+ 0x0c09 => 'en_AU',
87
+ 0x1009 => 'en_CA',
88
+ 0x1409 => 'en_NZ',
89
+ 0x1809 => 'en_IE',
90
+ 0x1c09 => 'en_ZA',
91
+ 0x2009 => 'en_JA',
92
+ 0x2409 => 'en_CB',
93
+ 0x2809 => 'en_BZ',
94
+ 0x2c09 => 'en_TT',
95
+ 0x3009 => 'en_ZW',
96
+ 0x3409 => 'en_PH',
97
+ 0x4009 => 'en_IN',
98
+ 0x4409 => 'en_MY',
99
+ 0x4809 => 'en_SG',
100
+ 0x0425 => 'et_EE',
101
+ 0x0438 => 'fo_FO',
102
+ 0x464 => 'fil_PH',
103
+ 0x040b => 'fi_FI',
104
+ 0x040c => 'fr_FR',
105
+ 0x080c => 'fr_BE',
106
+ 0x0c0c => 'fr_CA',
107
+ 0x100c => 'fr_CH',
108
+ 0x140c => 'fr_LU',
109
+ 0x180c => 'fr_MC',
110
+ 0x0462 => 'fy_NL',
111
+ 0x0456 => 'gl_ES',
112
+ 0x0437 => 'ka_GE',
113
+ 0x0407 => 'de_DE',
114
+ 0x0807 => 'de_CH',
115
+ 0x0c07 => 'de_AT',
116
+ 0x1007 => 'de_LU',
117
+ 0x1407 => 'de_LI',
118
+ 0x0408 => 'el_GR',
119
+ 0x046f => 'kl_GL',
120
+ 0x0447 => 'gu_IN',
121
+ 0x0468 => 'ha_NG-Latn',
122
+ 0x040d => 'he_IL',
123
+ 0x0439 => 'hi_IN',
124
+ 0x040e => 'hu_HU',
125
+ 0x040f => 'is_IS',
126
+ 0x0421 => 'id_ID',
127
+ 0x045d => 'iu_CA-Cans',
128
+ 0x085d => 'iu_CA-Latn',
129
+ 0x083c => 'ga_IE',
130
+ 0x0434 => 'xh_ZA',
131
+ 0x0435 => 'zu_ZA',
132
+ 0x0410 => 'it_IT',
133
+ 0x0810 => 'it_CH',
134
+ 0x0411 => 'ja_JP',
135
+ 0x044b => 'kn_IN',
136
+ 0x043f => 'kk_KZ',
137
+ 0x0453 => 'kh_KH',
138
+ 0x0486 => 'qut_GT',
139
+ 0x0487 => 'rw_RW',
140
+ 0x0457 => 'kok_IN',
141
+ 0x0412 => 'ko_KR',
142
+ 0x0812 => 'ko_KR@win95',
143
+ 0x0440 => 'ky_KG',
144
+ 0x0454 => 'lo_LA',
145
+ 0x0426 => 'lv_LV',
146
+ 0x0427 => 'lt_LT',
147
+ 0x0827 => 'lt_LT@win98',
148
+ 0x082e => 'wee_DE',
149
+ 0x046e => 'lb_LU',
150
+ 0x042f => 'mk_MK',
151
+ 0x043e => 'ms_MY',
152
+ 0x083e => 'ms_BN',
153
+ 0x044c => 'ml_IN',
154
+ 0x043a => 'mt_MT',
155
+ 0x0481 => 'mi_NZ',
156
+ 0x047a => 'arn_CL',
157
+ 0x044e => 'mr_IN',
158
+ 0x047c => 'moh_CA',
159
+ 0x0450 => 'mn_MN',
160
+ 0x0850 => 'mn_CN',
161
+ 0x0461 => 'ne_NP',
162
+ 0x0414 => 'nb_NO',
163
+ 0x0814 => 'nn_NO',
164
+ 0x0482 => 'oc_FR',
165
+ 0x0448 => 'or_IN',
166
+ 0x0463 => 'ps_AF',
167
+ 0x0429 => 'fa_IR',
168
+ 0x0415 => 'pl_PL',
169
+ 0x0416 => 'pt_BR',
170
+ 0x0816 => 'pt_PT',
171
+ 0x0446 => 'pa_IN',
172
+ 0x046b => 'quz_BO',
173
+ 0x086b => 'quz_EC',
174
+ 0x0c6b => 'quz_PE',
175
+ 0x0418 => 'ro_RO',
176
+ 0x0417 => 'rm_CH',
177
+ 0x0419 => 'ru_RU',
178
+ 0x243b => 'smn_FI',
179
+ 0x103b => 'smj_NO',
180
+ 0x143b => 'smj_SE',
181
+ 0x043b => 'se_NO',
182
+ 0x083b => 'se_SE',
183
+ 0x0c3b => 'se_FI',
184
+ 0x203b => 'sms_FI',
185
+ 0x183b => 'sma_NO',
186
+ 0x1c3b => 'sma_SE',
187
+ 0x044f => 'sa_IN',
188
+ 0x0c1a => 'sr_SP-Cyrl',
189
+ 0x1c1a => 'sr_BA-Cyrl',
190
+ 0x081a => 'sr_SP-Latn',
191
+ 0x181a => 'sr_BA-Latn',
192
+ 0x046c => 'ns_ZA',
193
+ 0x0432 => 'tn_ZA',
194
+ 0x045b => 'si_LK',
195
+ 0x041b => 'sk_SK',
196
+ 0x0424 => 'sl_SI',
197
+ 0x040a => 'es_ES-ts',
198
+ 0x080a => 'es_MX',
199
+ 0x0c0a => 'es_ES',
200
+ 0x100a => 'es_GT',
201
+ 0x140a => 'es_CR',
202
+ 0x180a => 'es_PA',
203
+ 0x1c0a => 'es_DO',
204
+ 0x200a => 'es_VE',
205
+ 0x240a => 'es_CO',
206
+ 0x280a => 'es_PE',
207
+ 0x2c0a => 'es_AR',
208
+ 0x300a => 'es_EC',
209
+ 0x340a => 'es_CL',
210
+ 0x380a => 'es_UY',
211
+ 0x3c0a => 'es_PY',
212
+ 0x400a => 'es_BO',
213
+ 0x440a => 'es_SV',
214
+ 0x480a => 'es_HN',
215
+ 0x4c0a => 'es_NI',
216
+ 0x500a => 'es_PR',
217
+ 0x540a => 'es_US',
218
+ 0x0430 => 'sutu',
219
+ 0x0441 => 'sw_KE',
220
+ 0x041d => 'sv_SE',
221
+ 0x081d => 'sv_FI',
222
+ 0x045a => 'syr_SY',
223
+ 0x0428 => 'tg_TJ-Cyrl',
224
+ 0x085f => 'ber_DZ',
225
+ 0x0449 => 'ta_IN',
226
+ 0x0444 => 'tt_RU',
227
+ 0x044a => 'te_IN',
228
+ 0x041e => 'th_TH',
229
+ 0x0451 => 'bo_CN',
230
+ 0x0851 => 'bo_BT',
231
+ 0x041f => 'tr_TR',
232
+ 0x0442 => 'tk_TM',
233
+ 0x0480 => 'ug_CN',
234
+ 0x0422 => 'uk_UA',
235
+ 0x042e => 'wen_DE',
236
+ 0x0420 => 'ur_PK',
237
+ 0x0820 => 'tr_IN',
238
+ 0x0443 => 'uz_UZ-Latn',
239
+ 0x0843 => 'uz_UZ-Cyrl',
240
+ 0x042a => 'vi_VN',
241
+ 0x0452 => 'cy_GB',
242
+ 0x0488 => 'wo_SN',
243
+ 0x0485 => 'sah_RU',
244
+ 0x0478 => 'ii_CN',
245
+ 0x046a => 'yo_NG',
246
+ }
247
+ end
248
+ end
@@ -0,0 +1,28 @@
1
+ require File.join(File.dirname(__FILE__), 'spec_helper')
2
+
3
+ describe "r18n-desktop" do
4
+
5
+ it "should return array of system locales" do
6
+ locales = R18n::I18n.system_locale
7
+ locales.class.should == Array
8
+ locales.should_not be_empty
9
+ locales.each do |locale|
10
+ locale.class.should == String
11
+ locale.should_not be_empty
12
+ end
13
+ end
14
+
15
+ it "should load I18n from system environment" do
16
+ i18n = R18n.from_env('')
17
+ i18n.class.should == R18n::I18n
18
+ if R18n::Locale != i18n.locale.class
19
+ i18n.locale.should_not be_empty
20
+ end
21
+
22
+ i18n = R18n.from_env('', 'en')
23
+ i18n.locale.should == R18n::Locale.new('en')
24
+
25
+ R18n.get.should == i18n
26
+ end
27
+
28
+ end
@@ -0,0 +1 @@
1
+ require File.join(File.dirname(__FILE__), '../lib/r18n-desktop')
metadata ADDED
@@ -0,0 +1,71 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: r18n-desktop
3
+ version: !ruby/object:Gem::Version
4
+ version: "0.1"
5
+ platform: ruby
6
+ authors:
7
+ - Andrey "A.I." Sitnik
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-11-18 00:00:00 +03:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: r18n-core
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - "="
22
+ - !ruby/object:Gem::Version
23
+ version: "0.1"
24
+ version:
25
+ description: A tool to translate your desktop application in several languages. It is just a wrap for R18n core library. It can localize your application, has translation for commons words, storage translation in rich YAML format with pluralization and procedures and has sublocales list for each supported locale.
26
+ email: andrey@sitnik.ru
27
+ executables: []
28
+
29
+ extensions: []
30
+
31
+ extra_rdoc_files:
32
+ - README.rdoc
33
+ - LICENSE
34
+ files:
35
+ - lib/r18n-desktop
36
+ - lib/r18n-desktop/java.rb
37
+ - lib/r18n-desktop/posix.rb
38
+ - lib/r18n-desktop/win32.rb
39
+ - lib/r18n-desktop.rb
40
+ - LICENSE
41
+ - Rakefile
42
+ - README.rdoc
43
+ has_rdoc: true
44
+ homepage: http://r18n.rubyforge.org/
45
+ post_install_message:
46
+ rdoc_options: []
47
+
48
+ require_paths:
49
+ - lib
50
+ required_ruby_version: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: "0"
55
+ version:
56
+ required_rubygems_version: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: "0"
61
+ version:
62
+ requirements: []
63
+
64
+ rubyforge_project: r18n-desktop
65
+ rubygems_version: 1.3.1
66
+ signing_key:
67
+ specification_version: 2
68
+ summary: A tool to translate your Ruby desktop application.
69
+ test_files:
70
+ - spec/r18n-desktop_spec.rb
71
+ - spec/spec_helper.rb