phrase 0.4.31 → 0.4.32
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.
- checksums.yaml +4 -4
- data/README.md +18 -13
- data/lib/generators/templates/phrase.rb +1 -1
- data/lib/phrase.rb +1 -1
- data/lib/phrase/engine.rb +5 -2
- data/lib/phrase/formats.rb +2 -0
- data/lib/phrase/formats/go_i18n.rb +23 -0
- data/lib/phrase/tool/commands/base.rb +1 -1
- data/lib/phrase/tool/commands/init.rb +4 -4
- data/lib/phrase/tool/commands/pull.rb +1 -1
- data/lib/phrase/tool/commands/push.rb +2 -2
- data/lib/phrase/tool/config.rb +3 -1
- data/lib/phrase/version.rb +1 -1
- data/phrase.gemspec +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f3c29d841e3576113329401e0d8d5dcd53ec48be
|
|
4
|
+
data.tar.gz: f5e08aad1c332ca72036066e7b1d61fefb56653b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1978b651d3db74749be389c8357c83fa239382fff0ebe15019855ee8194f9c5a5fa8dcb1bad31635e6022f7ccefb23c899c6ad91fd657d9f4b28f38699f57ce2
|
|
7
|
+
data.tar.gz: a95c37634d85cd2650076fa7892100926c615d1647d471568fafc2f8ae12516fb1a5d4e0b3b9614021137c5350ac2885d0e67d6274e5580d92a812efd3e12131
|
data/README.md
CHANGED
|
@@ -2,13 +2,16 @@
|
|
|
2
2
|
[](https://codeclimate.com/github/phrase/phrase)
|
|
3
3
|
[](http://travis-ci.org/phrase/phrase)
|
|
4
4
|
|
|
5
|
-
PhraseApp
|
|
5
|
+
PhraseApp is a translation management software. Set up a professional translation process to boost the quality of your translations with our powerful In-Context Editor or simply share and edit locale files with your team.
|
|
6
6
|
|
|
7
|
-
You can order professional translations
|
|
7
|
+
You can order professional translations through PhraseApp or work with your own translators. Our platform supports various programming languages and frameworks. Such as [Ruby on Rails, Symfony, Zend Framework, iOS, Android and many more](https://phraseapp.com/docs/general/supported-platforms).
|
|
8
8
|
|
|
9
|
-
This
|
|
9
|
+
This ruby gem allows you to integrate PhraseApp into your project and access your locale files through the PhraseApp [API](https://phraseapp.com/docs/api/overview).
|
|
10
10
|
|
|
11
|
-
[
|
|
11
|
+
[Try out PhraseApp for free](https://phraseapp.com/features) and start translating your app!
|
|
12
|
+
|
|
13
|
+
### In-Context Editor ###
|
|
14
|
+
PhraseApp comes with an In-Context editor that allows you to translate directly on your website. See our documentation on how to set it up: [In-Context Editor Setup](http://docs.phraseapp.com/guides/in-context-editor/).
|
|
12
15
|
|
|
13
16
|
### Supported Formats ###
|
|
14
17
|
You can manage your locale files with PhraseApp if you use one of the following formats:
|
|
@@ -24,6 +27,7 @@ You can manage your locale files with PhraseApp if you use one of the following
|
|
|
24
27
|
* Chrome JSON i18n
|
|
25
28
|
* Simple JSON
|
|
26
29
|
* Nested JSON
|
|
30
|
+
* GoI18n JSON
|
|
27
31
|
* i18n-node-2 JSON
|
|
28
32
|
* .NET ResX
|
|
29
33
|
* Windows Phone ResX
|
|
@@ -39,7 +43,7 @@ You can manage your locale files with PhraseApp if you use one of the following
|
|
|
39
43
|
* CSV
|
|
40
44
|
* PHP Array
|
|
41
45
|
* Zendesk CSV
|
|
42
|
-
* Laravel PHP
|
|
46
|
+
* Laravel/Flask PHP
|
|
43
47
|
* Angular Translate
|
|
44
48
|
* Mozilla Properties
|
|
45
49
|
* Play Properties
|
|
@@ -284,15 +288,16 @@ For example you can specify a different file name for files you retrieve via the
|
|
|
284
288
|
phrase init --secret=<YOUR_TOKEN> --locale-filename="<locale.name>.yml"
|
|
285
289
|
|
|
286
290
|
## Further Information
|
|
287
|
-
* [Read the PhraseApp
|
|
288
|
-
* [
|
|
289
|
-
* [Get in touch with
|
|
291
|
+
* [Read the PhraseApp Documentation](http://docs.phraseapp.com/)
|
|
292
|
+
* [Software Translation Managemeny with PhraseApp](https://phraseapp.com/features)
|
|
293
|
+
* [Get in touch with PhraseApp Team](https://phraseapp.com/contact)
|
|
290
294
|
|
|
291
295
|
## References
|
|
292
|
-
* [PhraseApp
|
|
293
|
-
* [
|
|
296
|
+
* [PhraseApp API Documentation](http://docs.phraseapp.com/api/v1/)
|
|
297
|
+
* [Demo of the In-Context Editor](http://demo.phraseapp.com)
|
|
298
|
+
* [Localization Guides and Software Translation Best Practices](http://localize-software.phraseapp.com/)
|
|
294
299
|
|
|
295
300
|
## Partner-Integrations
|
|
296
|
-
* [PhraseApp
|
|
297
|
-
* [Heroku Add-on](https://addons.heroku.com/phrase)
|
|
298
|
-
* [Cloudcontrol Add-on](https://phraseapp.com/docs/cloudcontrol/introduction)
|
|
301
|
+
* [Integrate PhraseApp with Ruby Motion](https://github.com/phrase/motion-phrase)
|
|
302
|
+
* [Integrate PhraseApp as a Heroku Add-on](https://addons.heroku.com/phrase)
|
|
303
|
+
* [Integrate PhraseApp as a Cloudcontrol Add-on](https://phraseapp.com/docs/cloudcontrol/introduction)
|
|
@@ -9,7 +9,7 @@ Phrase.configure do |config|
|
|
|
9
9
|
# Configure an array of key names that should not be handled
|
|
10
10
|
# with PhraseApp. This is useful when a key causes problems
|
|
11
11
|
# (Such as keys that are used by Rails internally)
|
|
12
|
-
config.ignored_keys = []
|
|
12
|
+
config.ignored_keys = ["number.*", "breadcrumb.*"]
|
|
13
13
|
|
|
14
14
|
# PhraseApp uses decorators to generate a unique identification key
|
|
15
15
|
# in context of your document. However, this might result in conflicts
|
data/lib/phrase.rb
CHANGED
data/lib/phrase/engine.rb
CHANGED
|
@@ -6,8 +6,11 @@ require 'i18n'
|
|
|
6
6
|
if defined? Rails
|
|
7
7
|
class Phrase::Engine < Rails::Engine
|
|
8
8
|
initializer 'phrase', :after => :disable_dependency_loading do |app|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
if Phrase.enabled?
|
|
10
|
+
require 'phrase/adapters/i18n'
|
|
11
|
+
require 'phrase/adapters/fast_gettext'
|
|
12
|
+
end
|
|
13
|
+
|
|
11
14
|
ActionView::Base.send :include, Phrase::ViewHelpers
|
|
12
15
|
end
|
|
13
16
|
end
|
data/lib/phrase/formats.rb
CHANGED
|
@@ -31,6 +31,7 @@ module Phrase
|
|
|
31
31
|
autoload :AngularTranslate, 'phrase/formats/angular_translate'
|
|
32
32
|
autoload :MozillaProperties, 'phrase/formats/mozilla_properties'
|
|
33
33
|
autoload :PlayProperties, 'phrase/formats/play_properties'
|
|
34
|
+
autoload :GoI18n, 'phrase/formats/go_i18n'
|
|
34
35
|
|
|
35
36
|
class Base
|
|
36
37
|
def self.supports_extension?(extension)
|
|
@@ -105,6 +106,7 @@ module Phrase
|
|
|
105
106
|
angular_translate: Phrase::Formats::AngularTranslate,
|
|
106
107
|
mozilla_properties: Phrase::Formats::MozillaProperties,
|
|
107
108
|
play_properties: Phrase::Formats::PlayProperties,
|
|
109
|
+
go_i18n: Phrase::Formats::GoI18n,
|
|
108
110
|
}
|
|
109
111
|
|
|
110
112
|
def self.config
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
|
2
|
+
|
|
3
|
+
module Phrase
|
|
4
|
+
module Formats
|
|
5
|
+
class GoI18n < Phrase::Formats::Base
|
|
6
|
+
def self.filename_for_locale(locale)
|
|
7
|
+
"#{locale.name}.all.json"
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
def self.locale_aware?
|
|
11
|
+
false
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def self.extensions
|
|
15
|
+
[:json]
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def self.target_directory
|
|
19
|
+
'locales/'
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -28,18 +28,18 @@ private
|
|
|
28
28
|
def create_locale(name)
|
|
29
29
|
begin
|
|
30
30
|
api_client.create_locale(name)
|
|
31
|
-
print_message "Created locale \"#{name}\"".green
|
|
31
|
+
print_message Rainbow("Created locale \"#{name}\"").green
|
|
32
32
|
rescue Exception => e
|
|
33
|
-
print_message "Notice: Locale \"#{name}\" could not be created (maybe it already exists)".
|
|
33
|
+
print_message Rainbow("Notice: Locale \"#{name}\" could not be created (maybe it already exists)").bright.red
|
|
34
34
|
end
|
|
35
35
|
end
|
|
36
36
|
|
|
37
37
|
def make_locale_default(name)
|
|
38
38
|
begin
|
|
39
39
|
api_client.make_locale_default(name)
|
|
40
|
-
print_message "Locale \"#{name}\" is now the default locale".green
|
|
40
|
+
print_message Rainbow("Locale \"#{name}\" is now the default locale").green
|
|
41
41
|
rescue Exception => e
|
|
42
|
-
print_message "Notice: Locale \"#{name}\" could not be made the default locale".
|
|
42
|
+
print_message Rainbow("Notice: Locale \"#{name}\" could not be made the default locale").bright.red
|
|
43
43
|
print_server_error(e.message)
|
|
44
44
|
end
|
|
45
45
|
end
|
|
@@ -52,7 +52,7 @@ private
|
|
|
52
52
|
File.open(target, "w") do |file|
|
|
53
53
|
file.write(content)
|
|
54
54
|
end
|
|
55
|
-
print_message "Saved to #{clean_path target}".green
|
|
55
|
+
print_message Rainbow("Saved to #{clean_path target}").green
|
|
56
56
|
rescue
|
|
57
57
|
print_error("Cannot write file to target folder (#{path})")
|
|
58
58
|
exit_command
|
|
@@ -27,7 +27,7 @@ class Phrase::Tool::Commands::Push < Phrase::Tool::Commands::Base
|
|
|
27
27
|
files = choose_files_to_upload(@file_names, @recursive)
|
|
28
28
|
|
|
29
29
|
if files.empty?
|
|
30
|
-
print_message "Could not find any files to upload".
|
|
30
|
+
print_message Rainbow("Could not find any files to upload").bright.red
|
|
31
31
|
exit_command
|
|
32
32
|
else
|
|
33
33
|
interruptable_upload_files(files)
|
|
@@ -91,7 +91,7 @@ private
|
|
|
91
91
|
locale = guess_locale_for_upload(file, @format)
|
|
92
92
|
end
|
|
93
93
|
api_client.upload(file, file_content(file), @tags, locale, @format, @update_translations, @skip_unverification, @skip_upload_tags, @convert_emoji)
|
|
94
|
-
print_message "OK".green
|
|
94
|
+
print_message Rainbow("OK").green
|
|
95
95
|
rescue Exception => e
|
|
96
96
|
print_error "Failed"
|
|
97
97
|
print_server_error(e.message)
|
data/lib/phrase/tool/config.rb
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
|
2
2
|
|
|
3
3
|
require 'json'
|
|
4
|
+
require 'erb'
|
|
4
5
|
|
|
5
6
|
class Phrase::Tool::Config
|
|
6
7
|
def load
|
|
@@ -8,7 +9,8 @@ class Phrase::Tool::Config
|
|
|
8
9
|
if File.exist?(".phrase")
|
|
9
10
|
begin
|
|
10
11
|
contents = File.read(".phrase")
|
|
11
|
-
|
|
12
|
+
parsed_content = ERB.new(contents).result
|
|
13
|
+
@config = JSON.parse(parsed_content)
|
|
12
14
|
rescue JSON::ParserError => err
|
|
13
15
|
$stderr.puts "Could not parse config file: #{err}"
|
|
14
16
|
end
|
data/lib/phrase/version.rb
CHANGED
data/phrase.gemspec
CHANGED
|
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
|
|
|
20
20
|
s.test_files = s.files.grep(%r{^(spec)/})
|
|
21
21
|
s.executables = %w(phrase)
|
|
22
22
|
s.require_paths = ["lib"]
|
|
23
|
-
s.add_dependency('
|
|
23
|
+
s.add_dependency('rainbow')
|
|
24
24
|
s.add_dependency('json')
|
|
25
25
|
s.add_dependency('i18n')
|
|
26
26
|
s.add_development_dependency('rake')
|
metadata
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: phrase
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.32
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Dynport GmbH
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2015-03-05 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
|
-
name:
|
|
14
|
+
name: rainbow
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
17
|
- - ">="
|
|
@@ -200,6 +200,7 @@ files:
|
|
|
200
200
|
- lib/phrase/formats/custom.rb
|
|
201
201
|
- lib/phrase/formats/gettext.rb
|
|
202
202
|
- lib/phrase/formats/gettext_template.rb
|
|
203
|
+
- lib/phrase/formats/go_i18n.rb
|
|
203
204
|
- lib/phrase/formats/ini.rb
|
|
204
205
|
- lib/phrase/formats/json.rb
|
|
205
206
|
- lib/phrase/formats/laravel.rb
|