pseudolocalization 0.9.1 → 0.10.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.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +0 -2
- data/.github/workflows/ruby-ci.yml +14 -8
- data/CHANGELOG.md +7 -1
- data/Gemfile.lock +4 -4
- data/README.md +8 -2
- data/lib/pseudolocalization/pseudolocalizer.rb +7 -5
- data/lib/pseudolocalization/version.rb +1 -1
- data/shipit.rubygems.yml +5 -4
- metadata +3 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '090ec80bbdb475a3a34314d973d911af6ae22121c50bb5bf9ca0fc9e9801df4c'
|
|
4
|
+
data.tar.gz: 6850bb50f3ccd2767ad8b5080c1616a7e82a7d5321d30568adb419efc1f06140
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 319d0c9e1f9aa8ac9439312e1ddba612a7a9f403f989cb056b79a8d909103425be7bcaa89ed45d89368b1b692ea7ae706ca055f72a8081055f0211a3cd1784f1
|
|
7
|
+
data.tar.gz: 967d013f09fbe58c769b441e3bfcc43154d0fb94922e7ab2e8c46c50dc02a106a7ef3fb97bd1e280412778e1b7526d5b206da417172c3c381054027b6bf75d9b
|
data/.github/dependabot.yml
CHANGED
|
@@ -6,26 +6,32 @@ on:
|
|
|
6
6
|
- '**'
|
|
7
7
|
push:
|
|
8
8
|
branches:
|
|
9
|
-
-
|
|
9
|
+
- main
|
|
10
10
|
|
|
11
11
|
jobs:
|
|
12
12
|
build:
|
|
13
13
|
name: Ruby ${{ matrix.version }} ${{ matrix.gemfile }}
|
|
14
|
-
runs-on: ubuntu-
|
|
14
|
+
runs-on: ubuntu-24.04
|
|
15
15
|
env:
|
|
16
16
|
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
|
|
17
17
|
strategy:
|
|
18
|
+
# Report every Ruby independently. Without this, one failing job
|
|
19
|
+
# cancels its siblings and hides their results.
|
|
20
|
+
fail-fast: false
|
|
18
21
|
matrix:
|
|
22
|
+
# Quoted on purpose. Unquoted, YAML reads 3.0 as the number 3 and
|
|
23
|
+
# setup-ruby then installs "latest 3.x" instead of Ruby 3.0.
|
|
19
24
|
version:
|
|
20
|
-
- 2.7
|
|
21
|
-
- 3.0
|
|
22
|
-
- 3.1
|
|
23
|
-
- 3.2
|
|
24
|
-
- 3.3
|
|
25
|
+
- '2.7'
|
|
26
|
+
- '3.0'
|
|
27
|
+
- '3.1'
|
|
28
|
+
- '3.2'
|
|
29
|
+
- '3.3'
|
|
30
|
+
- '3.4'
|
|
25
31
|
gemfile:
|
|
26
32
|
- Gemfile
|
|
27
33
|
steps:
|
|
28
|
-
- uses: actions/checkout@
|
|
34
|
+
- uses: actions/checkout@v7
|
|
29
35
|
|
|
30
36
|
- name: Set up Ruby ${{ matrix.version }}
|
|
31
37
|
uses: ruby/setup-ruby@v1
|
data/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|
|
6
6
|
## Unreleased
|
|
7
7
|
Nil.
|
|
8
8
|
|
|
9
|
+
## [0.10.0] - 2026-10-12
|
|
10
|
+
### Fixed
|
|
11
|
+
- Fixed slow matching in `ESCAPED_REGEX` on strings with many unclosed `<`, `{{`, `%{` or `&` (CWE-1333). Lazy wildcards became character classes bounded by each token's own delimiters. Output is unchanged or improved for well-formed input; a token containing a nested opener of its own kind (`<b <i>x</i>`, `{{ a {b} }}`, `&a&`) is no longer swallowed up to the first closer. Quoted HTML attribute values may now contain `<` and `>`.
|
|
12
|
+
- `ESCAPED_REGEX` now also preserves HTML comments (`<!-- -->`), Liquid tags (`{% %}`), markup spanning a newline, and `{`/`}` inside quoted Liquid strings; a `<` not followed by a letter, `/`, `!` or `?` is treated as text; a URL ends at `<` or `>`; only well-formed character references (`&name;`, `'`, `'`) are kept. Output is unchanged for every string in Shopify Core's English locale files except 19 Liquid email subjects, where `{% if … %}` tags are now preserved instead of pseudolocalized.
|
|
13
|
+
|
|
9
14
|
## [0.9.1] - 2024-06-27
|
|
10
15
|
### Added
|
|
11
16
|
- Added support for pseudolocalized translations [#82](https://github.com/Shopify/pseudolocalization/pull/82)
|
|
@@ -56,7 +61,8 @@ Nil.
|
|
|
56
61
|
|
|
57
62
|
Please refer to [GitHub releases](https://github.com/Shopify/pseudolocalization/releases) for releases prior to [0.8.0].
|
|
58
63
|
|
|
59
|
-
[Unreleased]: https://github.com/Shopify/pseudolocalization/compare/
|
|
64
|
+
[Unreleased]: https://github.com/Shopify/pseudolocalization/compare/v0.10.0...HEAD
|
|
65
|
+
[0.10.0]: https://github.com/Shopify/pseudolocalization/compare/v0.9.1...v0.10.0
|
|
60
66
|
[0.9.1]: https://github.com/Shopify/pseudolocalization/compare/0.9.0...0.9.1
|
|
61
67
|
[0.9.0]: https://github.com/Shopify/pseudolocalization/compare/0.8.4...0.9.0
|
|
62
68
|
[0.8.4]: https://github.com/Shopify/pseudolocalization/compare/0.8.3...0.8.4
|
data/Gemfile.lock
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
pseudolocalization (0.
|
|
4
|
+
pseudolocalization (0.10.0)
|
|
5
5
|
|
|
6
6
|
GEM
|
|
7
7
|
remote: https://rubygems.org/
|
|
8
8
|
specs:
|
|
9
|
-
minitest (5.
|
|
10
|
-
rake (13.
|
|
9
|
+
minitest (5.25.4)
|
|
10
|
+
rake (13.2.1)
|
|
11
11
|
|
|
12
12
|
PLATFORMS
|
|
13
13
|
ruby
|
|
@@ -18,4 +18,4 @@ DEPENDENCIES
|
|
|
18
18
|
rake (~> 13.0)
|
|
19
19
|
|
|
20
20
|
BUNDLED WITH
|
|
21
|
-
2.
|
|
21
|
+
2.4.22
|
data/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Pseudolocalization
|
|
2
2
|
|
|
3
|
-
[![Version][gem]][gem_url] [](https://github.com/Shopify/pseudolocalization/actions?query=workflow%3ACI)
|
|
4
4
|
|
|
5
5
|
[About this repo](#about-this-repo) | [How to use this repo](#how-to-use-this-repo) | [Contribute to this repo](#contribute-to-this-repo)
|
|
6
6
|
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
Internationalization is a hard and tedious process. Different character sets, different average word length, different pluralization rules... There's a lot going on and it's impossible to test against all possible scenarios. As a side effect, most of us will simply test against one or two known languages and hope for the best. Unfortunately, this often leads to broken UI elements, texts going out of bounds, or forgotten non-translated strings making their way into a final release.
|
|
11
11
|
|
|
12
|
-
As an example, let's examine the string "Set the power switch to 0."
|
|
12
|
+
As an example, let's examine the string "Set the power switch to 0.":
|
|
13
13
|
|
|
14
14
|
| Language | String | Characters | Percentage |
|
|
15
15
|
|----------|--------|------------|------------|
|
|
@@ -25,6 +25,12 @@ In an attempt to ease this whole process, we created a small tool that gives you
|
|
|
25
25
|
2. Expand words by doubling all vowels
|
|
26
26
|
3. Use English lookalike UTF8 characters for readability
|
|
27
27
|
|
|
28
|
+
For the example above, this looks like:
|
|
29
|
+
|
|
30
|
+
| Language | String | Characters | Percentage |
|
|
31
|
+
|----------|--------|------------|------------|
|
|
32
|
+
| Pseudo-English | Ṣḛḛṭ ṭḥḛḛ ṗṓṓẁḛḛṛ ṡẁḭḭṭͼḥ ṭṓṓ 0. | 32 chars | 23% more
|
|
33
|
+
|
|
28
34
|
## How to use this repo
|
|
29
35
|
### Installation
|
|
30
36
|
|
|
@@ -3,11 +3,13 @@ module Pseudolocalization
|
|
|
3
3
|
class Pseudolocalizer
|
|
4
4
|
ESCAPED_REGEX = Regexp.new("(#{
|
|
5
5
|
[
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
6
|
+
"<!--(?:[^-]|-[^-])*-->", # HTML comment
|
|
7
|
+
"<[a-zA-Z/!?][^<>\"']*(?:(?:\"[^\"]*\"|'[^']*')[^<>\"']*)*>", # HTML tag, end tag, doctype
|
|
8
|
+
"{{[^{}\"']*(?:(?:\"[^\"]*\"|'[^']*')[^{}\"']*)*}}", # Liquid output
|
|
9
|
+
"{%-?\\s*[a-zA-Z#][^%\"']*(?:(?:\"[^\"]*\"|'[^']*')[^%\"']*)*%}", # Liquid tag
|
|
10
|
+
"%{[^{}\\n]*}", # Ruby I18n interpolation
|
|
11
|
+
"https?:\/\/[^\\s<>]+", # URL
|
|
12
|
+
"&(?:[a-zA-Z][a-zA-Z0-9]*|#[0-9]+|#[xX][0-9a-fA-F]+);", # HTML character reference
|
|
11
13
|
].join('|')
|
|
12
14
|
})")
|
|
13
15
|
|
data/shipit.rubygems.yml
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: pseudolocalization
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.10.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Christian Blais
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: rake
|
|
@@ -70,7 +69,6 @@ licenses:
|
|
|
70
69
|
- MIT
|
|
71
70
|
metadata:
|
|
72
71
|
allowed_push_host: https://rubygems.org
|
|
73
|
-
post_install_message:
|
|
74
72
|
rdoc_options: []
|
|
75
73
|
require_paths:
|
|
76
74
|
- lib
|
|
@@ -85,8 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
85
83
|
- !ruby/object:Gem::Version
|
|
86
84
|
version: '0'
|
|
87
85
|
requirements: []
|
|
88
|
-
rubygems_version:
|
|
89
|
-
signing_key:
|
|
86
|
+
rubygems_version: 4.0.21
|
|
90
87
|
specification_version: 4
|
|
91
88
|
summary: Internationalization development tool
|
|
92
89
|
test_files: []
|