mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: remove i18n toggle (#69389)
* remove i18n toggle
* remove beta badge on language picker
* remove toggle from go code
* Revert "remove beta badge on language picker"
This reverts commit 3b76300aa7.
This commit is contained in:
@@ -49,7 +49,7 @@ func (hs *HTTPServer) setIndexViewData(c *contextmodel.ReqContext) (*dtos.IndexV
|
||||
locale := "en-US"
|
||||
language := "" // frontend will set the default language
|
||||
|
||||
if hs.Features.IsEnabled(featuremgmt.FlagInternationalization) && prefs.JSONData.Language != "" {
|
||||
if prefs.JSONData.Language != "" {
|
||||
language = prefs.JSONData.Language
|
||||
}
|
||||
|
||||
|
||||
@@ -186,13 +186,6 @@ var (
|
||||
Expression: "true", // turned on by default
|
||||
Owner: grafanaPluginsPlatformSquad,
|
||||
},
|
||||
{
|
||||
Name: "internationalization",
|
||||
Description: "Enables internationalization",
|
||||
State: FeatureStateStable,
|
||||
Expression: "true", // enabled by default
|
||||
Owner: grafanaUserEssentialsSquad,
|
||||
},
|
||||
{
|
||||
Name: "topnav",
|
||||
Description: "Enables new top navigation and page layouts",
|
||||
|
||||
@@ -26,7 +26,6 @@ scenes,alpha,@grafana/dashboards-squad,false,false,false,true
|
||||
disableSecretsCompatibility,alpha,@grafana/hosted-grafana-team,false,false,true,false
|
||||
logRequestsInstrumentedAsUnknown,alpha,@grafana/hosted-grafana-team,false,false,false,false
|
||||
dataConnectionsConsole,stable,@grafana/plugins-platform-backend,false,false,false,false
|
||||
internationalization,stable,@grafana/user-essentials,false,false,false,false
|
||||
topnav,stable,@grafana/user-essentials,false,false,false,false
|
||||
grpcServer,beta,@grafana/grafana-app-platform-squad,false,false,false,false
|
||||
entityStore,alpha,@grafana/grafana-app-platform-squad,true,false,false,false
|
||||
|
||||
|
@@ -115,10 +115,6 @@ const (
|
||||
// Enables a new top-level page called Connections. This page is an experiment that provides a better experience when you install and configure data sources and other plugins.
|
||||
FlagDataConnectionsConsole = "dataConnectionsConsole"
|
||||
|
||||
// FlagInternationalization
|
||||
// Enables internationalization
|
||||
FlagInternationalization = "internationalization"
|
||||
|
||||
// FlagTopnav
|
||||
// Enables new top navigation and page layouts
|
||||
FlagTopnav = "topnav"
|
||||
|
||||
@@ -224,10 +224,7 @@ func (s *Service) GetDefaults() *pref.Preference {
|
||||
HomeDashboardID: 0,
|
||||
JSONData: &pref.PreferenceJSONData{},
|
||||
}
|
||||
|
||||
if s.features.IsEnabled(featuremgmt.FlagInternationalization) {
|
||||
defaults.JSONData.Language = s.cfg.DefaultLanguage
|
||||
}
|
||||
defaults.JSONData.Language = s.cfg.DefaultLanguage
|
||||
|
||||
return defaults
|
||||
}
|
||||
|
||||
@@ -45,7 +45,9 @@ func TestGetDefaults(t *testing.T) {
|
||||
Theme: "light",
|
||||
Timezone: "UTC",
|
||||
HomeDashboardID: 0,
|
||||
JSONData: &pref.PreferenceJSONData{},
|
||||
JSONData: &pref.PreferenceJSONData{
|
||||
Language: "en-US",
|
||||
},
|
||||
}
|
||||
if diff := cmp.Diff(expected, preference); diff != "" {
|
||||
t.Fatalf("Result mismatch (-want +got):\n%s", diff)
|
||||
@@ -56,32 +58,6 @@ func TestGetDefaults(t *testing.T) {
|
||||
query := &pref.GetPreferenceWithDefaultsQuery{OrgID: 1}
|
||||
preference, err := prefService.GetWithDefaults(context.Background(), query)
|
||||
require.NoError(t, err)
|
||||
expected := &pref.Preference{
|
||||
WeekStart: &weekStart,
|
||||
Theme: "light",
|
||||
Timezone: "UTC",
|
||||
HomeDashboardID: 0,
|
||||
JSONData: &pref.PreferenceJSONData{},
|
||||
}
|
||||
if diff := cmp.Diff(expected, preference); diff != "" {
|
||||
t.Fatalf("Result mismatch (-want +got):\n%s", diff)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
func TestGetDefaultsWithI18nFeatureFlag(t *testing.T) {
|
||||
prefService := &Service{
|
||||
store: newFake(),
|
||||
cfg: setting.NewCfg(),
|
||||
features: featuremgmt.WithFeatures(featuremgmt.FlagInternationalization),
|
||||
}
|
||||
weekStart := ""
|
||||
prefService.cfg.DefaultLanguage = "en-US"
|
||||
prefService.cfg.DefaultTheme = "light"
|
||||
prefService.cfg.DateFormats.DefaultTimezone = "UTC"
|
||||
|
||||
t.Run("GetDefaults", func(t *testing.T) {
|
||||
preference := prefService.GetDefaults()
|
||||
expected := &pref.Preference{
|
||||
WeekStart: &weekStart,
|
||||
Theme: "light",
|
||||
|
||||
Reference in New Issue
Block a user