License in Localizer.scala
This commit is contained in:
parent
727c031dc7
commit
dff5bb9164
1 changed files with 20 additions and 3 deletions
|
@ -1,13 +1,30 @@
|
|||
/*
|
||||
This file is part of karl-marx.
|
||||
|
||||
karl-marx is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
karl-marx is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with karl-marx. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package org.congressodeiradicali.karlmarx
|
||||
|
||||
package object Locale {
|
||||
val ENGLISH_LOCALE = Map(
|
||||
val ENGLISH_LOCALE: Map[String, String] = Map(
|
||||
"ban.unauthorized" -> "Only an administrator can do this action",
|
||||
"ban.successful" -> "User was banned successfully",
|
||||
"ban.failed" -> "Cannot ban this user"
|
||||
)
|
||||
|
||||
val ITALIAN_LOCALE = Map(
|
||||
val ITALIAN_LOCALE: Map[String, String] = Map(
|
||||
"ban.unauthorized" -> "Solo un amministratore può compiere questa azione",
|
||||
"ban.successful" -> "Utente bannato con successo",
|
||||
"ban.failed" -> "Non sono riuscito a bannare questo utente"
|
||||
|
@ -16,7 +33,7 @@ package object Locale {
|
|||
|
||||
class Localizer(val locale: String) {
|
||||
|
||||
def getString(name: String) = locale match {
|
||||
def getString(name: String): String = locale match {
|
||||
case "en_EN" => Locale.ENGLISH_LOCALE(name)
|
||||
case "it_IT" => Locale.ITALIAN_LOCALE(name)
|
||||
case _ => Locale.ENGLISH_LOCALE(name)
|
||||
|
|
Loading…
Reference in a new issue