Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package rubygem-gettext_i18n_rails_js for
openSUSE:Factory checked in at 2022-02-02 22:41:23
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-gettext_i18n_rails_js (Old)
and /work/SRC/openSUSE:Factory/.rubygem-gettext_i18n_rails_js.new.1898
(New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-gettext_i18n_rails_js"
Wed Feb 2 22:41:23 2022 rev:9 rq:950627 version:1.3.1
Changes:
--------
---
/work/SRC/openSUSE:Factory/rubygem-gettext_i18n_rails_js/rubygem-gettext_i18n_rails_js.changes
2017-04-12 18:22:24.729388691 +0200
+++
/work/SRC/openSUSE:Factory/.rubygem-gettext_i18n_rails_js.new.1898/rubygem-gettext_i18n_rails_js.changes
2022-02-02 22:42:23.951131073 +0100
@@ -1,0 +2,13 @@
+Tue Jan 25 06:57:42 UTC 2022 - Stephan Kulow <[email protected]>
+
+updated to version 1.3.1
+ see installed CHANGELOG.md
+
+ ##
[1.3.1](https://github.com/webhippie/gettext_i18n_rails_js/releases/tag/v1.4.0)
- 2021-12-08
+
+ * Fixed multiline translation strings (@delxen)
+ * Switched to Codacy for coverage reports (@tboerger)
+ * Switched to GitHub actions for CI (@ezr-ondrej)
+
+
+-------------------------------------------------------------------
Old:
----
gettext_i18n_rails_js-1.3.0.gem
New:
----
gettext_i18n_rails_js-1.3.1.gem
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ rubygem-gettext_i18n_rails_js.spec ++++++
--- /var/tmp/diff_new_pack.JxNLsx/_old 2022-02-02 22:42:24.367128253 +0100
+++ /var/tmp/diff_new_pack.JxNLsx/_new 2022-02-02 22:42:24.375128199 +0100
@@ -1,7 +1,7 @@
#
# spec file for package rubygem-gettext_i18n_rails_js
#
-# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -12,7 +12,7 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
@@ -24,7 +24,7 @@
#
Name: rubygem-gettext_i18n_rails_js
-Version: 1.3.0
+Version: 1.3.1
Release: 0
%define mod_name gettext_i18n_rails_js
%define mod_full_name %{mod_name}-%{version}
@@ -32,8 +32,8 @@
BuildRequires: %{ruby >= 1.9.3}
BuildRequires: %{rubygem gem2rpm}
BuildRequires: ruby-macros >= 5
-Url: https://github.com/webhippie/gettext_i18n_rails_js
-Source: http://rubygems.org/gems/%{mod_full_name}.gem
+URL: https://github.com/webhippie/gettext_i18n_rails_js
+Source: https://rubygems.org/gems/%{mod_full_name}.gem
Source1: gem2rpm.yml
Summary: Extends gettext_i18n_rails making your .po files available to
client
License: MIT
++++++ gettext_i18n_rails_js-1.3.0.gem -> gettext_i18n_rails_js-1.3.1.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/CHANGELOG.md new/CHANGELOG.md
--- old/CHANGELOG.md 2017-03-16 14:17:56.000000000 +0100
+++ new/CHANGELOG.md 2021-12-09 01:17:49.000000000 +0100
@@ -1,42 +1,48 @@
# Changelog
+##
[1.3.1](https://github.com/webhippie/gettext_i18n_rails_js/releases/tag/v1.4.0)
- 2021-12-08
+
+* Fixed multiline translation strings (@delxen)
+* Switched to Codacy for coverage reports (@tboerger)
+* Switched to GitHub actions for CI (@ezr-ondrej)
+
##
[1.3.0](https://github.com/webhippie/gettext_i18n_rails_js/releases/tag/v1.3.0)
- 2017-03-16
-* Fixed Handlebars translations with options (@mikezaby)
-* Fixed latest Rubocop offenses (@mikezaby)
-* Dropped failing coveralls, fixed codeclimate (@tboerger)
+* Fixed Handlebars translations with options (@mikezaby)
+* Fixed latest Rubocop offenses (@mikezaby)
+* Dropped failing coveralls, fixed codeclimate (@tboerger)
##
[1.2.0](https://github.com/webhippie/gettext_i18n_rails_js/releases/tag/v1.2.0)
- 2016-06-02
-* Support for JSX files (@artemv)
-* Fixed test suite, reduced test matrix (@tboerger)
+* Support for JSX files (@artemv)
+* Fixed test suite, reduced test matrix (@tboerger)
##
[1.1.0](https://github.com/webhippie/gettext_i18n_rails_js/releases/tag/v1.1.0)
- 2016-06-02
-* Replace hyphens with underscores in locale var from DOM (@filib)
+* Replace hyphens with underscores in locale var from DOM (@filib)
##
[1.0.4](https://github.com/webhippie/gettext_i18n_rails_js/releases/tag/v1.0.4)
- 2016-05-31
-* Support ES2015 template strings (@bradbarrow)
+* Support ES2015 template strings (@bradbarrow)
##
[1.0.3](https://github.com/webhippie/gettext_i18n_rails_js/releases/tag/v1.0.3)
- 2015-11-03
-* Stop using bundler within the core lib (@domcleal)
+* Stop using bundler within the core lib (@domcleal)
##
[1.0.2](https://github.com/webhippie/gettext_i18n_rails_js/releases/tag/v1.0.2)
- 2015-03-30
-* Fixes exception when parsing empty js/coffee files (@tboerger)
-* Avoid methods defined in rake task exposing globally (@tboerger)
-* Added better configuration options (@tboerger)
+* Fixes exception when parsing empty js/coffee files (@tboerger)
+* Avoid methods defined in rake task exposing globally (@tboerger)
+* Added better configuration options (@tboerger)
##
[1.0.1](https://github.com/webhippie/gettext_i18n_rails_js/releases/tag/v1.0.1)
- 2015-02-24
-* Added missing javascripts to the gemspec (@tboerger)
+* Added missing javascripts to the gemspec (@tboerger)
##
[1.0.0](https://github.com/webhippie/gettext_i18n_rails_js/releases/tag/v1.0.0)
- 2015-02-24
-* Transfer from github.com/nubis/gettext_i18n_rails_js (@tboerger)
-* Added TravisCI, Rubocop and Coveralls (@tboerger)
-* Updated structure to my opinionated gem style (@tboerger)
-* Changed default handlebars function to ```__``` (@tboerger)
-* Added extended ```gettext_i18n_rails_js.yml``` (@tboerger)
+* Transfer from github.com/nubis/gettext_i18n_rails_js (@tboerger)
+* Added TravisCI, Rubocop and Coveralls (@tboerger)
+* Updated structure to my opinionated gem style (@tboerger)
+* Changed default handlebars function to ```__``` (@tboerger)
+* Added extended ```gettext_i18n_rails_js.yml``` (@tboerger)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/README.md new/README.md
--- old/README.md 2017-03-16 14:17:56.000000000 +0100
+++ new/README.md 2021-12-09 01:17:49.000000000 +0100
@@ -1,10 +1,9 @@
-# GettextI18nRailsJs
+# gettext_i18n_rails_js
-[](https://rubygems.org/gems/gettext_i18n_rails_js)
-[](https://travis-ci.org/webhippie/gettext_i18n_rails_js)
-[](https://codeclimate.com/github/webhippie/gettext_i18n_rails_js)
-[](https://codeclimate.com/github/webhippie/gettext_i18n_rails_js)
-[](https://gemnasium.com/webhippie/gettext_i18n_rails_js)
+[](https://github.com/webhippie/gettext_i18n_rails_js/actions/workflows/testing.yaml)
+[](https://matrix.to/#/#webhippie:matrix.org)
+[](https://www.codacy.com/gh/webhippie/gettext_i18n_rails_js/dashboard?utm_source=github.com&utm_medium=referral&utm_content=webhippie/gettext_i18n_rails_js&utm_campaign=Badge_Grade)
+[](https://badge.fury.io/rb/gettext_i18n_rails_js)
Extends [gettext_i18n_rails](https://github.com/grosser/gettext_i18n_rails),
making your .PO files available to client side javascript as JSON. It will find
@@ -13,33 +12,37 @@
of your assets, thus letting you access all your translations offline from
client side javascript.
-
## Versions
-This gem is tested on the following versions, it's also possible that it works
-with older versions, but because of version bumps at `gettext_i18n_rails` and
-`fast_gettext` we have dropped the older versions from the testing matrix:
-
-* Ruby
- * 2.1.0
- * 2.2.0
-* Rails
- * 3.2.21
- * 4.0.13
- * 4.1.16
- * 4.2.7
-
+For a list of the tested and supported Ruby and Rails versions please take a
+look at the [wokflow][workflow].
## Installation
```ruby
-gem "gettext_i18n_rails_js", "~> 1.2.0"
+gem "gettext_i18n_rails_js", "~> 1.2"
```
+## Versioning
+
+This library aims to adhere to [Semantic Versioning 2.0.0][semver]. Violations
+of this scheme should be reported as bugs. Specifically, if a minor or patch
+version is released that breaks backward compatibility, a new version should be
+immediately released that restores compatibility. Breaking changes to the
public
+API will only be introduced with new major versions.
+
+As a result of this policy, you can (and should) specify a dependency on this
+gem using the [Pessimistic Version Constraint][pvc] with two digits of
precision.
+
+For example:
+
+```ruby
+spec.add_dependency "gettext_i18n_rails_js", "~> 1.2"
+```
## Usage
-set up you rails application with gettext support as usual, afterwards just
+Set up you rails application with gettext support as usual, afterwards just
execute the following rake task to export your translations to JSON:
```bash
@@ -99,33 +102,32 @@
end
```
-
## Todo
-* More deep testing against multiple Rails versions
-* Extend the current test suite, especially handlebars
-
+* More deep testing against multiple Rails versions
+* Extend the current test suite, especially handlebars
## Contributing
Fork -> Patch -> Spec -> Push -> Pull Request
-
## Authors
-* [Thomas Boerger](https://github.com/tboerger)
-* [Nubis](https://github.com/nubis)
-* [Other
contributors](https://github.com/webhippie/gettext_i18n_rails_js/graphs/contributors)
-
+* [Thomas Boerger](https://github.com/tboerger)
+* [Nubis](https://github.com/nubis)
+* [Other
contributors](https://github.com/webhippie/gettext_i18n_rails_js/graphs/contributors)
## License
MIT
-
## Copyright
```
Copyright (c) 2012-2015 Dropmysite.com <https://dropmyemail.com>
Copyright (c) 2015 Webhippie <http://www.webhippie.de>
```
+
+[workflow]:
https://github.com/webhippie/gettext_i18n_rails_js/blob/master/.github/workflows/testing.yml
+[semver]: http://semver.org
+[pvc]: http://guides.rubygems.org/patterns/#pessimistic-version-constraint
Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/gettext_i18n_rails_js/config.rb
new/lib/gettext_i18n_rails_js/config.rb
--- old/lib/gettext_i18n_rails_js/config.rb 2017-03-16 14:17:56.000000000
+0100
+++ new/lib/gettext_i18n_rails_js/config.rb 2021-12-09 01:17:49.000000000
+0100
@@ -1,4 +1,5 @@
-# -*- coding: UTF-8 -*-
+# frozen_string_literal: true
+
#
# Copyright (c) 2012-2015 Dropmysite.com <https://dropmyemail.com>
# Copyright (c) 2015 Webhippie <http://www.webhippie.de>
@@ -25,10 +26,10 @@
module GettextI18nRailsJs
class Config
- attr_accessor :output_path
- attr_accessor :handlebars_function
- attr_accessor :javascript_function
- attr_accessor :jed_options
+ attr_accessor :output_path,
+ :handlebars_function,
+ :javascript_function,
+ :jed_options
def initialize(&block)
@output_path = defaults[:output_path]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/gettext_i18n_rails_js/engine.rb
new/lib/gettext_i18n_rails_js/engine.rb
--- old/lib/gettext_i18n_rails_js/engine.rb 2017-03-16 14:17:56.000000000
+0100
+++ new/lib/gettext_i18n_rails_js/engine.rb 2021-12-09 01:17:49.000000000
+0100
@@ -1,4 +1,5 @@
-# -*- coding: UTF-8 -*-
+# frozen_string_literal: true
+
#
# Copyright (c) 2012-2015 Dropmysite.com <https://dropmyemail.com>
# Copyright (c) 2015 Webhippie <http://www.webhippie.de>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/gettext_i18n_rails_js/parser/base.rb
new/lib/gettext_i18n_rails_js/parser/base.rb
--- old/lib/gettext_i18n_rails_js/parser/base.rb 2017-03-16
14:17:57.000000000 +0100
+++ new/lib/gettext_i18n_rails_js/parser/base.rb 2021-12-09
01:17:49.000000000 +0100
@@ -1,4 +1,5 @@
-# -*- coding: UTF-8 -*-
+# frozen_string_literal: true
+
#
# Copyright (c) 2012-2015 Dropmysite.com <https://dropmyemail.com>
# Copyright (c) 2015 Webhippie <http://www.webhippie.de>
@@ -36,7 +37,7 @@
# conflicts with other javascript libraries. You only need to define
# the base function name to replace "_" and all the other variants
# (s_, n_, N_) will be deduced automatically.
- attr_accessor :gettext_function
+ attr_writer :gettext_function
def gettext_function
@gettext_function ||= "__"
@@ -79,12 +80,18 @@
end.join(separator_for(function))
next if key == ""
+
results_for(key, file, line)
end
end
protected
+ def cleanup_multiline_line(value)
+ result = value.chomp
+ result.strip
+ end
+
def cleanup_value(value)
value
.tr("\n", "\n")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/gettext_i18n_rails_js/parser/handlebars.rb
new/lib/gettext_i18n_rails_js/parser/handlebars.rb
--- old/lib/gettext_i18n_rails_js/parser/handlebars.rb 2017-03-16
14:17:57.000000000 +0100
+++ new/lib/gettext_i18n_rails_js/parser/handlebars.rb 2021-12-09
01:17:49.000000000 +0100
@@ -1,4 +1,5 @@
-# -*- coding: UTF-8 -*-
+# frozen_string_literal: true
+
#
# Copyright (c) 2012-2015 Dropmysite.com <https://dropmyemail.com>
# Copyright (c) 2015 Webhippie <http://www.webhippie.de>
@@ -73,7 +74,7 @@
.*?
)
[}]{2}
- /x
+ /xm
end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/gettext_i18n_rails_js/parser/javascript.rb
new/lib/gettext_i18n_rails_js/parser/javascript.rb
--- old/lib/gettext_i18n_rails_js/parser/javascript.rb 2017-03-16
14:17:57.000000000 +0100
+++ new/lib/gettext_i18n_rails_js/parser/javascript.rb 2021-12-09
01:17:49.000000000 +0100
@@ -1,4 +1,5 @@
-# -*- coding: UTF-8 -*-
+# frozen_string_literal: true
+
#
# Copyright (c) 2012-2015 Dropmysite.com <https://dropmyemail.com>
# Copyright (c) 2015 Webhippie <http://www.webhippie.de>
@@ -37,6 +38,7 @@
[
".js",
".jsx",
+ ".vue",
".coffee"
].include? ::File.extname(file)
end
@@ -45,14 +47,46 @@
def collect_for(value)
::File.open(value) do |f|
+ multiline = false
+ line_no = 0
+ buffer = ""
f.each_line.each_with_index.collect do |line, idx|
- line.scan(invoke_regex).collect do |function, arguments|
- yield(function, arguments, idx + 1)
+ if multiline
+ buffer << cleanup_multiline_line(line)
+ else
+ buffer = line
+ line_no = idx + 1
+ end
+
+ if invoke_regex =~ buffer
+ multiline = false
+ buffer.scan(invoke_regex).collect do |function, arguments|
+ yield(function, arguments, line_no)
+ end
+ elsif invoke_open_regex =~ buffer
+ buffer << cleanup_multiline_line(buffer) unless multiline
+ buffer << " "
+ multiline = true
+ []
+ else
+ []
end
end.inject([], :+).compact
end
end
+ def invoke_open_regex
+ #
+ # * Matches the function call grouping the method used (__, n__, N__)
+ # * A parenthesis to start the arguments to the function.
+ # * Used to identify translation start on a single line
+ #
+
+ /
+ (\b[snN]?#{gettext_function})\(
+ /x
+ end
+
def invoke_regex
#
# * Matches the function call grouping the method used (__, n__, N__)
@@ -70,7 +104,7 @@
#{arg_regex}
)?
\)
- /x
+ /xm
end
def arg_regex
@@ -88,10 +122,10 @@
'(?:[^'\\]|\\.)*?'|
"(?:[^"\\]|\\.)*?"|
`(?:[^`\\]|\\.)*?`|
- [a-zA-Z0-9_\.()]*?
+ [a-zA-Z0-9_.()]*?
)
\s*
- /x
+ /xm
end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/gettext_i18n_rails_js/parser.rb
new/lib/gettext_i18n_rails_js/parser.rb
--- old/lib/gettext_i18n_rails_js/parser.rb 2017-03-16 14:17:57.000000000
+0100
+++ new/lib/gettext_i18n_rails_js/parser.rb 2021-12-09 01:17:49.000000000
+0100
@@ -1,4 +1,5 @@
-# -*- coding: UTF-8 -*-
+# frozen_string_literal: true
+
#
# Copyright (c) 2012-2015 Dropmysite.com <https://dropmyemail.com>
# Copyright (c) 2015 Webhippie <http://www.webhippie.de>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/gettext_i18n_rails_js/task.rb
new/lib/gettext_i18n_rails_js/task.rb
--- old/lib/gettext_i18n_rails_js/task.rb 2017-03-16 14:17:57.000000000
+0100
+++ new/lib/gettext_i18n_rails_js/task.rb 2021-12-09 01:17:49.000000000
+0100
@@ -1,4 +1,5 @@
-# -*- coding: UTF-8 -*-
+# frozen_string_literal: true
+
#
# Copyright (c) 2012-2015 Dropmysite.com <https://dropmyemail.com>
# Copyright (c) 2015 Webhippie <http://www.webhippie.de>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/gettext_i18n_rails_js/version.rb
new/lib/gettext_i18n_rails_js/version.rb
--- old/lib/gettext_i18n_rails_js/version.rb 2017-03-16 14:17:57.000000000
+0100
+++ new/lib/gettext_i18n_rails_js/version.rb 2021-12-09 01:17:49.000000000
+0100
@@ -1,4 +1,5 @@
-# -*- coding: UTF-8 -*-
+# frozen_string_literal: true
+
#
# Copyright (c) 2012-2015 Dropmysite.com <https://dropmyemail.com>
# Copyright (c) 2015 Webhippie <http://www.webhippie.de>
@@ -27,7 +28,7 @@
class Version
MAJOR = 1
MINOR = 3
- PATCH = 0
+ PATCH = 1
PRE = nil
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/gettext_i18n_rails_js.rb
new/lib/gettext_i18n_rails_js.rb
--- old/lib/gettext_i18n_rails_js.rb 2017-03-16 14:17:56.000000000 +0100
+++ new/lib/gettext_i18n_rails_js.rb 2021-12-09 01:17:49.000000000 +0100
@@ -1,4 +1,5 @@
-# -*- coding: UTF-8 -*-
+# frozen_string_literal: true
+
#
# Copyright (c) 2012-2015 Dropmysite.com <https://dropmyemail.com>
# Copyright (c) 2015 Webhippie <http://www.webhippie.de>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/tasks/gettext_i18n_rails_js_tasks.rake
new/lib/tasks/gettext_i18n_rails_js_tasks.rake
--- old/lib/tasks/gettext_i18n_rails_js_tasks.rake 2017-03-16
14:17:57.000000000 +0100
+++ new/lib/tasks/gettext_i18n_rails_js_tasks.rake 2021-12-09
01:17:49.000000000 +0100
@@ -1,4 +1,5 @@
-# -*- coding: UTF-8 -*-
+# frozen_string_literal: true
+
#
# Copyright (c) 2012-2015 Dropmysite.com <https://dropmyemail.com>
# Copyright (c) 2015 Webhippie <http://www.webhippie.de>
@@ -49,6 +50,7 @@
"rhtml",
"js",
"jsx",
+ "vue",
"coffee",
"handlebars",
"hbs",
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata 2017-03-16 14:17:56.000000000 +0100
+++ new/metadata 2021-12-09 01:17:49.000000000 +0100
@@ -1,7 +1,7 @@
--- !ruby/object:Gem::Specification
name: gettext_i18n_rails_js
version: !ruby/object:Gem::Version
- version: 1.3.0
+ version: 1.3.1
platform: ruby
authors:
- Thomas Boerger
@@ -9,7 +9,7 @@
autorequire:
bindir: bin
cert_chain: []
-date: 2017-03-16 00:00:00.000000000 Z
+date: 2021-12-09 00:00:00.000000000 Z
dependencies:
- !ruby/object:Gem::Dependency
name: bundler
@@ -40,7 +40,7 @@
- !ruby/object:Gem::Version
version: '0'
- !ruby/object:Gem::Dependency
- name: yard
+ name: rspec
requirement: !ruby/object:Gem::Requirement
requirements:
- - ">="
@@ -54,7 +54,7 @@
- !ruby/object:Gem::Version
version: '0'
- !ruby/object:Gem::Dependency
- name: rspec
+ name: yard
requirement: !ruby/object:Gem::Requirement
requirements:
- - ">="
@@ -68,61 +68,61 @@
- !ruby/object:Gem::Version
version: '0'
- !ruby/object:Gem::Dependency
- name: rails
+ name: gettext
requirement: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
- version: 3.2.0
+ version: 3.0.2
type: :runtime
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
- version: 3.2.0
+ version: 3.0.2
- !ruby/object:Gem::Dependency
- name: gettext
+ name: gettext_i18n_rails
requirement: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
- version: 3.0.2
+ version: 0.7.1
type: :runtime
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
- version: 3.0.2
+ version: 0.7.1
- !ruby/object:Gem::Dependency
- name: gettext_i18n_rails
+ name: po_to_json
requirement: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
- version: 0.7.1
+ version: 1.0.0
type: :runtime
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
- version: 0.7.1
+ version: 1.0.0
- !ruby/object:Gem::Dependency
- name: po_to_json
+ name: rails
requirement: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
- version: 1.0.0
+ version: 3.2.0
type: :runtime
prerelease: false
version_requirements: !ruby/object:Gem::Requirement
requirements:
- - ">="
- !ruby/object:Gem::Version
- version: 1.0.0
+ version: 3.2.0
description: |2
It will find translations inside your .js and .coffee files, then it will
create JSON versions of your .PO files and will let you serve them with
the
@@ -152,6 +152,7 @@
- spec/fixtures/example.coffee
- spec/fixtures/example.handlebars
- spec/fixtures/example.js
+- spec/fixtures/example.vue
- spec/gettext_i18n_rails_js/parser/handlebars_spec.rb
- spec/gettext_i18n_rails_js/parser/javascript_spec.rb
- spec/gettext_i18n_rails_js_spec.rb
@@ -177,18 +178,18 @@
- !ruby/object:Gem::Version
version: '0'
requirements: []
-rubyforge_project:
-rubygems_version: 2.5.1
+rubygems_version: 3.1.2
signing_key:
specification_version: 4
summary: Extends gettext_i18n_rails making your .po files available to client
side
javascript as JSON
test_files:
-- spec/fixtures/example.coffee
-- spec/fixtures/example.handlebars
-- spec/fixtures/example.js
+- spec/support/with_file.rb
+- spec/gettext_i18n_rails_js_spec.rb
- spec/gettext_i18n_rails_js/parser/handlebars_spec.rb
- spec/gettext_i18n_rails_js/parser/javascript_spec.rb
-- spec/gettext_i18n_rails_js_spec.rb
- spec/spec_helper.rb
-- spec/support/with_file.rb
+- spec/fixtures/example.js
+- spec/fixtures/example.coffee
+- spec/fixtures/example.vue
+- spec/fixtures/example.handlebars
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/spec/fixtures/example.vue
new/spec/fixtures/example.vue
--- old/spec/fixtures/example.vue 1970-01-01 01:00:00.000000000 +0100
+++ new/spec/fixtures/example.vue 2021-12-09 01:17:49.000000000 +0100
@@ -0,0 +1,21 @@
+<template>
+ <base-table-actions v-if="canInteract"
+ class="spec-banner-actions">
+
+ <div v-if="canCopy"
+ @click="handleCopy"
+ class="dropdown-item">{{ __("Hello\nBuddy") }}</div>
+
+ <div v-if="canArchive"
+ @click="handleArchive"
+ class="dropdown-item">{{ archivePlaceholder }}</div>
+ </base-table-actions>
+</template>
+
+
+<script>
+function pepito() {
+ var string = "this" + __('json') + 'should be translated';
+ alert(n__('item', 'items', 3));
+}
+</script>
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/spec/gettext_i18n_rails_js/parser/handlebars_spec.rb
new/spec/gettext_i18n_rails_js/parser/handlebars_spec.rb
--- old/spec/gettext_i18n_rails_js/parser/handlebars_spec.rb 2017-03-16
14:17:57.000000000 +0100
+++ new/spec/gettext_i18n_rails_js/parser/handlebars_spec.rb 2021-12-09
01:17:49.000000000 +0100
@@ -1,4 +1,5 @@
-# -*- coding: UTF-8 -*-
+# frozen_string_literal: true
+
#
# Copyright (c) 2012-2015 Dropmysite.com <https://dropmyemail.com>
# Copyright (c) 2015 Webhippie <http://www.webhippie.de>
@@ -150,12 +151,24 @@
# end
# end
- # it "finds interpolated multi-line messages" do
- # content = <<-EOF
- # """ Parser should grab
- # #{ __("This") } __("known bug")
- # """
- # EOF
+ # rubocop:disable Style/TrailingCommaInArrayLiteral
+ it "finds interpolated multi-line messages" do
+ content = <<-EOF
+ <div>{{{__ 'Hello, my name is <span class="name">John Doe</span>
+ and this is a very long string'}}}</div>
+ EOF
+ with_file content do |path|
+ expect(parser.parse(path, [])).to(
+ eq(
+ [
+ ["Hello, my name is <span class=\"name\">John Doe</span>
+ and this is a very long string", "#{path}:1"],
+ ]
+ )
+ )
+ end
+ end
+ # rubocop:enable Style/TrailingCommaInArrayLiteral
# with_file content do |path|
# expect(parser.parse(path, [])).to(
@@ -250,6 +263,7 @@
end
end
+ # rubocop:disable Style/FormatStringToken
it "does not parse options" do
content = <<-EOF
<div>
@@ -267,6 +281,7 @@
)
end
end
+ # rubocop:enable Style/FormatStringToken
# it "does not parse internal functions" do
# content = <<-EOF
@@ -285,8 +300,8 @@
describe "parses handlebars files" do
let(:example) do
File.expand_path(
- "../../../fixtures/example.handlebars",
- __FILE__
+ "../../fixtures/example.handlebars",
+ __dir__
)
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/spec/gettext_i18n_rails_js/parser/javascript_spec.rb
new/spec/gettext_i18n_rails_js/parser/javascript_spec.rb
--- old/spec/gettext_i18n_rails_js/parser/javascript_spec.rb 2017-03-16
14:17:57.000000000 +0100
+++ new/spec/gettext_i18n_rails_js/parser/javascript_spec.rb 2021-12-09
01:17:49.000000000 +0100
@@ -1,4 +1,5 @@
-# -*- coding: UTF-8 -*-
+# frozen_string_literal: true
+
#
# Copyright (c) 2012-2015 Dropmysite.com <https://dropmyemail.com>
# Copyright (c) 2015 Webhippie <http://www.webhippie.de>
@@ -37,6 +38,14 @@
expect(parser.target?("foo/bar/xxx.coffee")).to be_truthy
end
+ it "targets .vue" do
+ expect(parser.target?("foo/bar/xxx.vue")).to be_truthy
+ end
+
+ it "targets .jsx" do
+ expect(parser.target?("foo/bar/xxx.jsx")).to be_truthy
+ end
+
it "does not target cows" do
expect(parser.target?("foo/bar/xxx.cows")).to be_falsey
end
@@ -191,6 +200,25 @@
end
end
+ it "finds multi-line translations" do
+ content = <<-'EOF'
+ """ Parser should grab
+ __(`Hello, my name is <span class="name">John Doe</span>
+ and this is a very long string`)
+ """
+ EOF
+
+ with_file content do |path|
+ expect(parser.parse(path, [])).to(
+ eq(
+ [
+ ["Hello, my name is <span class=\"name\">John Doe</span> and
this is a very long string", "#{path}:2"]
+ ]
+ )
+ )
+ end
+ end
+
it "does not capture a false positive" do
content = <<-'EOF'
bla = should_not_be_registered__("xxxx", "yyyy")
@@ -264,11 +292,56 @@
end
end
+ describe "parses vue files" do
+ let(:example) do
+ File.expand_path(
+ "../../fixtures/example.vue",
+ __dir__
+ )
+ end
+
+ let(:parsed_example) do
+ parser.parse(example, [])
+ end
+
+ it "parses all translations" do
+ expect(parsed_example).to(
+ eq(
+ [
+ ["Hello\\nBuddy", "#{example}:7"],
+ ["json", "#{example}:18"],
+ ["item\u0000items", "#{example}:19"]
+ ]
+ )
+ )
+ end
+
+ it "accepts changing the translate method" do
+ parser.gettext_function = "gettext"
+
+ content = <<-'EOF'
+ var string = \"this\" + gettext('json') + 'should be translated';
+ EOF
+
+ with_file content do |path|
+ expect(parser.parse(path, [])).to(
+ eq(
+ [
+ ["json", "#{path}:1"]
+ ]
+ )
+ )
+ end
+
+ parser.gettext_function = "__"
+ end
+ end
+
describe "parses javascript files" do
let(:example) do
File.expand_path(
- "../../../fixtures/example.js",
- __FILE__
+ "../../fixtures/example.js",
+ __dir__
)
end
@@ -295,14 +368,16 @@
parser.gettext_function = "gettext"
content = <<-'EOF'
- var string = \"this\" + gettext('json') + 'should be translated';
+ <template><div>{{ gettext('name') }}</div></template>
+ <script>var string = \"this\" + gettext('json') + 'should be
translated';</script>
EOF
with_file content do |path|
expect(parser.parse(path, [])).to(
eq(
[
- ["json", "#{path}:1"]
+ ["name", "#{path}:1"],
+ ["json", "#{path}:2"]
]
)
)
@@ -315,8 +390,8 @@
describe "parses coffee files" do
let(:example) do
File.expand_path(
- "../../../fixtures/example.coffee",
- __FILE__
+ "../../fixtures/example.coffee",
+ __dir__
)
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/spec/gettext_i18n_rails_js_spec.rb
new/spec/gettext_i18n_rails_js_spec.rb
--- old/spec/gettext_i18n_rails_js_spec.rb 2017-03-16 14:17:57.000000000
+0100
+++ new/spec/gettext_i18n_rails_js_spec.rb 2021-12-09 01:17:49.000000000
+0100
@@ -1,4 +1,5 @@
-# -*- coding: UTF-8 -*-
+# frozen_string_literal: true
+
#
# Copyright (c) 2012-2015 Dropmysite.com <https://dropmyemail.com>
# Copyright (c) 2015 Webhippie <http://www.webhippie.de>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/spec/spec_helper.rb new/spec/spec_helper.rb
--- old/spec/spec_helper.rb 2017-03-16 14:17:57.000000000 +0100
+++ new/spec/spec_helper.rb 2021-12-09 01:17:49.000000000 +0100
@@ -1,4 +1,5 @@
-# -*- coding: UTF-8 -*-
+# frozen_string_literal: true
+
#
# Copyright (c) 2012-2015 Dropmysite.com <https://dropmyemail.com>
# Copyright (c) 2015 Webhippie <http://www.webhippie.de>
@@ -23,17 +24,19 @@
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
-require "simplecov"
-require "codeclimate-test-reporter" if ENV["CODECLIMATE_REPO_TOKEN"]
-
-SimpleCov.start do
- add_filter "/spec"
+if ENV.key? "CODACY_PROJECT_TOKEN"
+ begin
+ require "codacy-coverage"
+ Codacy::Reporter.start
+ rescue StandardError
+ puts "Failed to load codacy-coverage gem"
+ end
end
require "gettext_i18n_rails_js"
require "rspec"
-Dir[File.expand_path("../support/**/*.rb", __FILE__)].each do |file|
+Dir[File.expand_path("support/**/*.rb", __dir__)].sort.each do |file|
require file
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/spec/support/with_file.rb
new/spec/support/with_file.rb
--- old/spec/support/with_file.rb 2017-03-16 14:17:57.000000000 +0100
+++ new/spec/support/with_file.rb 2021-12-09 01:17:49.000000000 +0100
@@ -1,4 +1,5 @@
-# -*- coding: UTF-8 -*-
+# frozen_string_literal: true
+
#
# Copyright (c) 2012-2015 Dropmysite.com <https://dropmyemail.com>
# Copyright (c) 2015 Webhippie <http://www.webhippie.de>