Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix https://github.com/Apipie/apipie-rails/issues/490 #491

Merged
merged 1 commit into from
Oct 13, 2016
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: 6 additions & 4 deletions lib/apipie/apipie_module.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,16 @@ def self.debug(message)
end

# get application description for given or default version
def self.app_info(version = nil)
if app_info_version_valid? version
Apipie.markup_to_html(self.configuration.app_info[version])
def self.app_info(version = nil, lang = nil)
info = if app_info_version_valid? version
translate(self.configuration.app_info[version], lang)
elsif app_info_version_valid? Apipie.configuration.default_version
Apipie.markup_to_html(self.configuration.app_info[Apipie.configuration.default_version])
translate(self.configuration.app_info[Apipie.configuration.default_version], lang)
else
"Another API description"
end

Apipie.markup_to_html info
end

def self.api_base_url(version = nil)
Expand Down
2 changes: 1 addition & 1 deletion lib/apipie/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def to_json(version, resource_name, method_name, lang)
{
:docs => {
:name => Apipie.configuration.app_name,
:info => translate(Apipie.app_info(version), lang),
:info => Apipie.app_info(version, lang),
:copyright => Apipie.configuration.copyright,
:doc_url => Apipie.full_url(url_args),
:api_url => Apipie.api_base_url(version),
Expand Down