mirror of
https://github.com/Prominence/grails-translations-plugin.git
synced 2026-01-09 19:06:41 +03:00
Added error message if bundle wasn't found.
This commit is contained in:
parent
675eb1d055
commit
0a90793b02
@ -12,13 +12,15 @@ class TranslationsOverviewController {
|
|||||||
def show() {
|
def show() {
|
||||||
|
|
||||||
if (!params.bundleName) {
|
if (!params.bundleName) {
|
||||||
// render error
|
redirect action: 'index'
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
Bundle bundle = bundleService.findBundleByName(params.bundleName as String)
|
Bundle bundle = bundleService.findBundleByName(params.bundleName as String)
|
||||||
|
|
||||||
if (!bundle) {
|
if (!bundle) {
|
||||||
// render error
|
render view: 'index', model: [message: g.message(code: 'plugin.translations.error.bundleNotFound', args: [params.bundleName as String])]
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
render view: 'show', model: [bundle: bundle]
|
render view: 'show', model: [bundle: bundle]
|
||||||
|
|||||||
@ -2,4 +2,6 @@ plugin.translations.overview.index.page.title = Translations overview
|
|||||||
plugin.translations.overview.show.page.title = Bundle {0}
|
plugin.translations.overview.show.page.title = Bundle {0}
|
||||||
|
|
||||||
plugin.translations.totalRecords = Total: {0} records
|
plugin.translations.totalRecords = Total: {0} records
|
||||||
plugin.translations.totalBundles = Total: {0} bundles
|
plugin.translations.totalBundles = Total: {0} bundles
|
||||||
|
|
||||||
|
plugin.translations.error.bundleNotFound = Cannot find bundle <b>{0}</b>.
|
||||||
@ -2,4 +2,6 @@ plugin.translations.overview.index.page.title = Translations overview
|
|||||||
plugin.translations.overview.show.page.title = Bundle {0}
|
plugin.translations.overview.show.page.title = Bundle {0}
|
||||||
|
|
||||||
plugin.translations.totalRecords = Total: {0} records
|
plugin.translations.totalRecords = Total: {0} records
|
||||||
plugin.translations.totalBundles = Total: {0} bundles
|
plugin.translations.totalBundles = Total: {0} bundles
|
||||||
|
|
||||||
|
plugin.translations.error.bundleNotFound = Cannot find bundle <b>{0}</b>.
|
||||||
@ -2,4 +2,6 @@ plugin.translations.overview.index.page.title = Translations overview
|
|||||||
plugin.translations.overview.show.page.title = Bundle {0}
|
plugin.translations.overview.show.page.title = Bundle {0}
|
||||||
|
|
||||||
plugin.translations.totalRecords = Total: {0} records
|
plugin.translations.totalRecords = Total: {0} records
|
||||||
plugin.translations.totalBundles = Total: {0} bundles
|
plugin.translations.totalBundles = Total: {0} bundles
|
||||||
|
|
||||||
|
plugin.translations.error.bundleNotFound = Cannot find bundle <b>{0}</b>.
|
||||||
@ -2,4 +2,6 @@ plugin.translations.overview.index.page.title = Обзор переводов
|
|||||||
plugin.translations.overview.show.page.title = Бандл {0}
|
plugin.translations.overview.show.page.title = Бандл {0}
|
||||||
|
|
||||||
plugin.translations.totalRecords = Всего: {0} записей
|
plugin.translations.totalRecords = Всего: {0} записей
|
||||||
plugin.translations.totalBundles = Всего: {0} бандлов
|
plugin.translations.totalBundles = Всего: {0} бандлов
|
||||||
|
|
||||||
|
plugin.translations.error.bundleNotFound = Бандл с именем <b>{0}</b> не найден.
|
||||||
@ -7,16 +7,21 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
<g:if test="${message}">
|
||||||
|
<div class="alert alert-danger">
|
||||||
|
${message}
|
||||||
|
</div>
|
||||||
|
</g:if>
|
||||||
<g:if test="${bundles}">
|
<g:if test="${bundles}">
|
||||||
<ol>
|
<ol>
|
||||||
<g:each in="${bundles}" var="bundle">
|
<g:each in="${bundles}" var="bundle">
|
||||||
<li><g:link action="show" params="${[bundleName: bundle.name]}" >${bundle.name}</g:link></li>
|
<li><g:link action="show" params="${[bundleName: bundle.name]}" >${bundle.name}</g:link></li>
|
||||||
</g:each>
|
</g:each>
|
||||||
</ol>
|
</ol>
|
||||||
|
<g:message code="plugin.translations.totalBundles" args="${[bundles.size()]}"/>
|
||||||
</g:if>
|
</g:if>
|
||||||
<g:else>
|
<g:else>
|
||||||
There is no bundles!
|
There is no bundles!
|
||||||
</g:else>
|
</g:else>
|
||||||
<g:message code="plugin.translations.totalBundles" args="${[bundles.size()]}"/>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
Loading…
x
Reference in New Issue
Block a user