• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

sleede / fab-manager / #106

pending completion
#106

push

coveralls-ruby

sylvainbx
Merge branch 'dev' for release 6.0.0

704 of 704 new or added lines in 168 files covered. (100.0%)

7919 of 13474 relevant lines covered (58.77%)

15.29 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/app/controllers/api/translations_controller.rb
1
# frozen_string_literal: true
2

3
# API Controller for managing front-end translations
4
class API::TranslationsController < API::APIController
×
5
  before_action :set_locale
×
6

7
  def show
×
8
    translations = I18n.t params[:state]
×
9
    if translations.instance_of?(String) && translations.start_with?('translation missing')
×
10
      render json: { error: translations }, status: :unprocessable_entity
×
11
    else
×
12
      path = params[:state]
×
13
      res = path.split('.').reverse.reduce(translations) { |r, e| { e.to_sym => r } }
×
14
      render json: res, status: :ok
×
15
    end
×
16
  end
×
17

18
  private
×
19

20
  def set_locale
×
21
    I18n.locale = params[:locale] || I18n.default_locale
×
22
  end
×
23
end
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc