-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added localization and one click validation
- Loading branch information
1 parent
f294d65
commit ac20b9f
Showing
15 changed files
with
334 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
package controller | ||
|
||
import "flag" | ||
|
||
var ( | ||
lang = flag.String("lang", "en", "Language") | ||
Data map[string]map[string]string | ||
) | ||
|
||
func InitLocalizer() { | ||
|
||
switch *lang { | ||
case "en": | ||
Data = map[string]map[string]string{ | ||
"index": { | ||
"source_details": "Source Details", | ||
"destination_details": "Destination Details", | ||
"server": "Server", | ||
"account": "Account", | ||
"password": "Password", | ||
"validate": "Validate Credentials", | ||
"sync": "Start Synchronization", | ||
"user_queue": "User Table", | ||
}, | ||
"login": { | ||
"sign_in": "Sign In", | ||
"description": "Sign in to access admin panel", | ||
"username": "Username", | ||
"password": "Password", | ||
}, | ||
"admin": { | ||
"index": "Index", | ||
"source_server": "Source Server", | ||
"source_account": "Source Account", | ||
"dest_server": "Destination Server", | ||
"dest_account": "Destination Account", | ||
"status": "Status", | ||
"actions": "Actions", | ||
}, | ||
"table": { | ||
"index": "Index", | ||
"source_server": "Source Server", | ||
"source_account": "Source Account", | ||
"dest_server": "Destination Server", | ||
"dest_account": "Destination Account", | ||
"status": "Status", | ||
"actions": "Actions", | ||
}, | ||
} | ||
case "tr": | ||
Data = map[string]map[string]string{ | ||
"index": { | ||
"source_details": "Kaynak Bilgileri", | ||
"destination_details": "Hedef Bilgileri", | ||
"server": "Sunucu", | ||
"account": "Hesap", | ||
"password": "Parola", | ||
"validate": "Bilgileri Doğrula", | ||
"sync": "Senkronizasyonu Başlat", | ||
"user_queue": "Kullanıcı İşlem Kuyruğu", | ||
}, | ||
"login": { | ||
"sign_in": "Giriş Yap", | ||
"description": "Admin paneline erişebilmek için giriş yapın.", | ||
"username": "Kullanıcı Adı", | ||
"password": "Parola", | ||
}, | ||
"admin": { | ||
"index": "Sıra", | ||
"source_server": "Kaynak Sunucu", | ||
"source_account": "Kaynak Hesap", | ||
"dest_server": "Hedef Sunucu", | ||
"dest_account": "Hedef Hesap", | ||
"status": "Durum", | ||
"actions": "Eylemler", | ||
}, | ||
"table": { | ||
"index": "Sıra", | ||
"source_server": "Kaynak Sunucu", | ||
"source_account": "Kaynak Hesap", | ||
"dest_server": "Hedef Sunucu", | ||
"dest_account": "Hedef Hesap", | ||
"status": "Durum", | ||
"actions": "Eylemler", | ||
}, | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package internal | ||
|
||
import ( | ||
"net/smtp" | ||
) | ||
|
||
func Email(creds Credentials) error { | ||
|
||
smtpHost := "" | ||
smtpPort := "" | ||
from := "" | ||
username := "" | ||
password := "" | ||
to := creds.Account | ||
subject := "" | ||
message := "" | ||
|
||
auth := smtp.CRAMMD5Auth(username, password) | ||
|
||
msg := []byte("From: " + from + "\r\n" + | ||
"To: " + to + "\r\n" + | ||
"Subject: [" + "" + "] " + subject + "\r\n\r\n" + | ||
message + "\r\n") | ||
|
||
return smtp.SendMail(smtpHost+":"+smtpPort, auth, from, []string{to}, msg) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.