Initial commit, first views
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
//
|
||||
// Localizer.swift
|
||||
// Firebonk
|
||||
//
|
||||
// Created by Patrick Müller on 12.01.23.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
private class Localizer {
|
||||
|
||||
static let sharedInstance = Localizer()
|
||||
|
||||
func localize(string: String, tableName: String, plural: Bool) -> String {
|
||||
var localizedString: String
|
||||
if plural{
|
||||
localizedString = NSLocalizedString(string, tableName: tableName, value:"**\(self)**", comment: "plural")
|
||||
}else{
|
||||
localizedString = NSLocalizedString(string, tableName: tableName, value:"**\(self)**", comment: "")
|
||||
}
|
||||
|
||||
return localizedString
|
||||
}
|
||||
}
|
||||
|
||||
extension String {
|
||||
func localized(tableName: String = "Localizable", plural: Bool = false) -> String {
|
||||
return Localizer.sharedInstance.localize(string: self, tableName: tableName, plural: plural)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
General.strings
|
||||
Firebonk
|
||||
|
||||
Created by Patrick Müller on 12.01.23.
|
||||
|
||||
*/
|
||||
|
||||
/* Tab Names */
|
||||
"dashboard" = "Dashboard";
|
||||
"people" = "Personen";
|
||||
"spaces" = "Spaces";
|
||||
"profile" = "Profil";
|
||||
@@ -0,0 +1,7 @@
|
||||
/*
|
||||
Localizable.strings
|
||||
Firebonk
|
||||
|
||||
Created by Patrick Müller on 12.01.23.
|
||||
|
||||
*/
|
||||
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
General.strings
|
||||
Firebonk
|
||||
|
||||
Created by Patrick Müller on 12.01.23.
|
||||
|
||||
*/
|
||||
|
||||
/* Tab Names */
|
||||
"dashboard" = "Dashboard";
|
||||
"people" = "People";
|
||||
"spaces" = "Spaces";
|
||||
"profile" = "Profile";
|
||||
@@ -0,0 +1,7 @@
|
||||
/*
|
||||
Localizable.strings
|
||||
Firebonk
|
||||
|
||||
Created by Patrick Müller on 12.01.23.
|
||||
|
||||
*/
|
||||
Reference in New Issue
Block a user