Merged r24548 from trunk to 6.1-stable (#43906).

git-svn-id: https://svn.redmine.org/redmine/branches/6.1-stable@24551 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA
2026-04-02 23:36:59 +00:00
parent 281af2cfff
commit 5da929fa67
2 changed files with 19 additions and 2 deletions

View File

@@ -21,7 +21,7 @@ class HelpController < ApplicationController
def show_wiki_syntax
type = params[:type].nil? ? "" : "#{params[:type]}_"
lang = current_language.to_s
lang = current_language.to_s.downcase
template = "help/wiki_syntax/#{Setting.text_formatting}/#{lang}/wiki_syntax_#{type}#{Setting.text_formatting}"
unless lookup_context.exists?(template)
lang = "en"

View File

@@ -66,13 +66,30 @@ class HelpControllerTest < Redmine::ControllerTest
assert_select 'h1', :text => "Wiki Syntax Schnellreferenz (CommonMark Markdown (GitHub Flavored))"
end
def test_get_help_wiki_syntax_should_use_lowercase_region_locale_directory
user = User.find(2)
user.language = 'ta-IN'
user.save!
@request.session[:user_id] = 2
# The Tamil CommonMark help is stored under the lowercase ta-in directory, not ta-IN.
with_settings :text_formatting => 'common_mark' do
get :show_wiki_syntax
end
assert_response :success
assert_select 'h1', :text => "விக்கி தொடரியல் விரைவு குறிப்பு (CommonMark Markdown (GitHub Flavored))"
end
def test_get_help_wiki_syntax_should_fallback_to_english
user = User.find(2)
user.language = 'ro'
user.save!
@request.session[:user_id] = 2
get :show_wiki_syntax
with_settings :text_formatting => 'common_mark' do
get :show_wiki_syntax
end
assert_response :success
assert_select 'h1', :text => "Wiki Syntax Quick Reference (CommonMark Markdown (GitHub Flavored))"