Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ jobs:
fail-fast: false

env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
GOOGLE_TRANSLATE_API_KEY: ${{ secrets.GOOGLE_TRANSLATE_API_KEY }}
COVERAGE: 1
RUBYOPT: "--enable-frozen-string-literal --debug-frozen-string-literal"
Expand All @@ -45,16 +44,7 @@ jobs:
bundler-cache: ${{ matrix.ruby-version != 'head' }}
bundler: latest
rubygems: latest
- name: "Determine whether to upload coverage"
if: ${{ env.CC_TEST_REPORTER_ID && startsWith(matrix.ruby-version, '3.4') && github.ref == 'refs/heads/main' }}
run: echo UPLOAD_COVERAGE=1 >> $GITHUB_ENV
- name: Install dependencies
run: bundle install
- name: Run tests
if: ${{ !env.UPLOAD_COVERAGE }}
run: bundle exec rake
- name: Run tests and upload coverage
uses: paambaati/codeclimate-action@v9
if: ${{ env.UPLOAD_COVERAGE }}
with:
coverageCommand: bundle exec rake
1 change: 1 addition & 0 deletions lib/i18n/tasks/scanners/erb_ast_scanner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ module I18n::Tasks::Scanners
# Scan for I18n.translate calls in ERB-file using regexp and Parser/Prism
class ErbAstScanner < RubyScanner
include OccurrenceFromPosition

DEFAULT_REGEXP = /<%(={1,2}|-|\#-?|%)?(.*?)([-=])?%>/m

# Parser scanner, method called in RubyScanner
Expand Down
1 change: 1 addition & 0 deletions lib/i18n/tasks/translators/base_translator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module I18n::Tasks
module Translators
class BaseTranslator
include ::I18n::Tasks::Logging

# @param [I18n::Tasks::BaseTask] i18n_tasks
def initialize(i18n_tasks)
@i18n_tasks = i18n_tasks
Expand Down
1 change: 1 addition & 0 deletions lib/i18n/tasks/translators/openai_translator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
module I18n::Tasks::Translators
class OpenAiTranslator < BaseTranslator
include ::I18n::Tasks::Data::LanguageNames

# max allowed texts per request
BATCH_SIZE = 50
DEFAULT_SYSTEM_PROMPT = <<~PROMPT.squish
Expand Down
4 changes: 2 additions & 2 deletions spec/i18n_tasks_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,11 @@

it "detects missing" do
es_keys = expected_missing_keys_diff.grep(/^es\./) +
(expected_missing_keys_in_source.map { |k| (k[0] == "⮕") ? k : "es.#{k}" })
expected_missing_keys_in_source.map { |k| (k[0] == "⮕") ? k : "es.#{k}" }
out, result = run_cmd_capture_stdout_and_result "missing"
expect(result).to eq :exit1
expect(out).to be_i18n_keys(expected_missing_keys_diff +
(expected_missing_keys_in_source.map { |k| (k[0] == "⮕") ? k : "all.#{k}" }))
expected_missing_keys_in_source.map { |k| (k[0] == "⮕") ? k : "all.#{k}" })
expect(run_cmd("missing", "-les")).to be_i18n_keys es_keys
expect(run_cmd("missing", "es")).to be_i18n_keys es_keys
end
Expand Down
1 change: 1 addition & 0 deletions spec/key_pattern_matching_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

RSpec.describe "Key pattern" do
include I18n::Tasks::KeyPatternMatching

describe "matching" do
describe "*" do
it "as suffix" do
Expand Down
Loading