This repository has been archived by the owner on Mar 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6b9ffd5
commit 4097d79
Showing
15 changed files
with
295 additions
and
35 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
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,81 @@ | ||
startup_reading: | ||
description: | ||
other: "Reading config..." | ||
startup_no_views_defined: | ||
description: | ||
other: "No views defined..." | ||
|
||
tab_explore_title: | ||
description: "Top screen tab name" | ||
other: "Explore" | ||
tab_my_repos_title: | ||
description: "Top screen tab name" | ||
other: "My repositories" | ||
|
||
explore_repositories_item_type_label: | ||
description: "Label name used to identify the resource, like to count them" | ||
other: "Repositories" | ||
explore_repositories_not_found: | ||
description: "Displayed when none are found" | ||
other: "No repositories found." | ||
explore_repositories_fetching: | ||
description: "Displayed when fetching repositories" | ||
other: "Fetching repositories..." | ||
|
||
explore_sidebar_architectures: | ||
description: "Explore sidebar architectures title" | ||
other: "Architectures" | ||
explore_sidebar_how_to_pull_instructions: | ||
description: "Instructions on how to pull the selected image" | ||
other: "How to pull \"{{.Name}}\"?" | ||
|
||
my_repositories_item_type_label: | ||
description: "Label name used to identify the resource, like to count them" | ||
other: "Repositories" | ||
my_repositories_not_found: | ||
description: "Displayed when none are found" | ||
other: "No repositories found." | ||
my_repositories_not_found_tip: | ||
description: "Displayed when none are found" | ||
other: "Have you set DOCKER_USERNAME and DOCKER_BEARER?" | ||
my_repositories_fetching: | ||
description: "Displayed when fetching repositories" | ||
other: "Fetching repositories..." | ||
|
||
my_repos_sidebar_visibility: | ||
description: "" | ||
other: "Visibility" | ||
my_repos_sidebar_visibility_private: | ||
description: "" | ||
other: "Private" | ||
my_repos_sidebar_visibility_public: | ||
description: "" | ||
other: "Public" | ||
my_repos_sidebar_stats: | ||
description: "" | ||
other: "Stats" | ||
my_repos_sidebar_timestamps: | ||
description: "" | ||
other: "Timestamps" | ||
my_repos_sidebar_updated_at: | ||
description: "" | ||
other: "Last Update" | ||
my_repos_sidebar_created_at: | ||
description: "" | ||
other: "Created At" | ||
|
||
column_header_name: | ||
description: "Common table column header" | ||
other: "Name" | ||
column_header_organization: | ||
description: "Common table column header" | ||
other: "Organization" | ||
column_header_updated_at: | ||
description: "Common table column header" | ||
other: "Updated At" | ||
column_header_created_at: | ||
description: "Common table column header" | ||
other: "Created At" | ||
column_header_description: | ||
description: "Common table column header" | ||
other: "Description" |
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,81 @@ | ||
startup_reading: | ||
description: | ||
other: "Récupération de la configuration..." | ||
startup_no_views_defined: | ||
description: | ||
other: "Aucune vues trouvées..." | ||
|
||
tab_explore_title: | ||
description: "Top screen tab name" | ||
other: "Explorer" | ||
tab_my_repos_title: | ||
description: "Top screen tab name" | ||
other: "Mes dépôts" | ||
|
||
explore_repositories_item_type_label: | ||
description: "Label name used to identify the resource, like to count them" | ||
other: "Dépôts" | ||
explore_repositories_not_found: | ||
description: "Displayed when none are found" | ||
other: "Aucun dépôt trouvé." | ||
explore_repositories_fetching: | ||
description: "Displayed when fetching repositories" | ||
other: "Récupération des dépôts..." | ||
|
||
explore_sidebar_architectures: | ||
description: "Explore sidebar architectures title" | ||
other: "Architectures" | ||
explore_sidebar_how_to_pull_instructions: | ||
description: "Instructions on how to pull the selected image" | ||
other: "Comment obtenir \"{{.Name}}\" ?" | ||
|
||
my_repositories_item_type_label: | ||
description: "Label name used to identify the resource, like to count them" | ||
other: "Dépôts" | ||
my_repositories_not_found: | ||
description: "Displayed when none are found" | ||
other: "Aucun de vos dépôts n'a été trouvé." | ||
my_repositories_not_found_tip: | ||
description: "Displayed when none are found" | ||
other: "Avez-vous configuré DOCKER_USERNAME et DOCKER_BEARER ?" | ||
my_repositories_fetching: | ||
description: "Displayed when fetching repositories" | ||
other: "Récupération des dépôts..." | ||
|
||
my_repos_sidebar_visibility: | ||
description: "" | ||
other: "Visibilité" | ||
my_repos_sidebar_visibility_private: | ||
description: "" | ||
other: "Privé" | ||
my_repos_sidebar_visibility_public: | ||
description: "" | ||
other: "Publique" | ||
my_repos_sidebar_stats: | ||
description: "" | ||
other: "Stats" | ||
my_repos_sidebar_timestamps: | ||
description: "" | ||
other: "Dates" | ||
my_repos_sidebar_updated_at: | ||
description: "" | ||
other: "Dernière mise à jour" | ||
my_repos_sidebar_created_at: | ||
description: "" | ||
other: "Créé le" | ||
|
||
column_header_name: | ||
description: "Column name used in explore view" | ||
other: "Nom" | ||
column_header_organization: | ||
description: "Column name used in explore view" | ||
other: "Société" | ||
column_header_updated_at: | ||
description: "Column name used in explore view" | ||
other: "Dernière mise à jour" | ||
column_header_created_at: | ||
description: "Column name used in explore view" | ||
other: "Créé le" | ||
column_header_description: | ||
description: "Column name used in explore view" | ||
other: "Description" |
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,40 @@ | ||
package locales | ||
|
||
import ( | ||
"github.com/cubiest/jibberjabber" | ||
"github.com/nicksnyder/go-i18n/v2/i18n" | ||
"golang.org/x/text/language" | ||
"gopkg.in/yaml.v2" | ||
) | ||
|
||
var default_language = language.English | ||
|
||
type Locales struct { | ||
Localizer *i18n.Localizer | ||
} | ||
|
||
func NewLocales() Locales { | ||
return Locales{ | ||
Localizer: getLocalizer(), | ||
} | ||
} | ||
|
||
func getLocalizer() *i18n.Localizer { | ||
bundle := i18n.NewBundle(default_language) | ||
bundle.RegisterUnmarshalFunc("yaml", yaml.Unmarshal) | ||
bundle.MustLoadMessageFile("./internal/config/locales/en.yaml") | ||
bundle.MustLoadMessageFile("./internal/config/locales/fr.yaml") | ||
return i18n.NewLocalizer(bundle, getLanguage().String(), default_language.String()) | ||
} | ||
|
||
func getLanguage() language.Tag { | ||
userLanguage, err := jibberjabber.DetectLanguage() | ||
if err != nil { | ||
return default_language | ||
} | ||
return language.Make(userLanguage) | ||
} | ||
|
||
func (locales Locales) L(msgId string) string { | ||
return locales.Localizer.MustLocalize(&i18n.LocalizeConfig{MessageID: msgId}) | ||
} |
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.