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() {
|
||||
|
||||
if (!params.bundleName) {
|
||||
// render error
|
||||
redirect action: 'index'
|
||||
return
|
||||
}
|
||||
|
||||
Bundle bundle = bundleService.findBundleByName(params.bundleName as String)
|
||||
|
||||
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]
|
||||
|
||||
@ -3,3 +3,5 @@ plugin.translations.overview.show.page.title = Bundle {0}
|
||||
|
||||
plugin.translations.totalRecords = Total: {0} records
|
||||
plugin.translations.totalBundles = Total: {0} bundles
|
||||
|
||||
plugin.translations.error.bundleNotFound = Cannot find bundle <b>{0}</b>.
|
||||
@ -3,3 +3,5 @@ plugin.translations.overview.show.page.title = Bundle {0}
|
||||
|
||||
plugin.translations.totalRecords = Total: {0} records
|
||||
plugin.translations.totalBundles = Total: {0} bundles
|
||||
|
||||
plugin.translations.error.bundleNotFound = Cannot find bundle <b>{0}</b>.
|
||||
@ -3,3 +3,5 @@ plugin.translations.overview.show.page.title = Bundle {0}
|
||||
|
||||
plugin.translations.totalRecords = Total: {0} records
|
||||
plugin.translations.totalBundles = Total: {0} bundles
|
||||
|
||||
plugin.translations.error.bundleNotFound = Cannot find bundle <b>{0}</b>.
|
||||
@ -3,3 +3,5 @@ plugin.translations.overview.show.page.title = Бандл {0}
|
||||
|
||||
plugin.translations.totalRecords = Всего: {0} записей
|
||||
plugin.translations.totalBundles = Всего: {0} бандлов
|
||||
|
||||
plugin.translations.error.bundleNotFound = Бандл с именем <b>{0}</b> не найден.
|
||||
@ -7,16 +7,21 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<g:if test="${message}">
|
||||
<div class="alert alert-danger">
|
||||
${message}
|
||||
</div>
|
||||
</g:if>
|
||||
<g:if test="${bundles}">
|
||||
<ol>
|
||||
<g:each in="${bundles}" var="bundle">
|
||||
<li><g:link action="show" params="${[bundleName: bundle.name]}" >${bundle.name}</g:link></li>
|
||||
</g:each>
|
||||
</ol>
|
||||
<g:message code="plugin.translations.totalBundles" args="${[bundles.size()]}"/>
|
||||
</g:if>
|
||||
<g:else>
|
||||
There is no bundles!
|
||||
</g:else>
|
||||
<g:message code="plugin.translations.totalBundles" args="${[bundles.size()]}"/>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
x
Reference in New Issue
Block a user