Skip to content

Commit 3825543

Browse files
fix couple of bugs
1 parent 0ee67b1 commit 3825543

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

pkg/translations/translations.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func TranslationHelper() (func(key string, defaultValue string) string, func())
1717
v.AutomaticEnv()
1818

1919
// Load from JSON file
20-
v.SetConfigName("github-mcp-translations")
20+
v.SetConfigName("github-mcp-server")
2121
v.SetConfigType("json")
2222
v.AddConfigPath(".")
2323

@@ -34,7 +34,13 @@ func TranslationHelper() (func(key string, defaultValue string) string, func())
3434
if value, exists := translationKeyMap[key]; exists {
3535
return value
3636
}
37-
// build it dynamically so we can dump it to a file to fill missing translation keys
37+
// check if the env var exists
38+
if value, exists := os.LookupEnv("GITHUB_MCP_" + key); exists {
39+
// TODO I could not get Viper to play ball reading the env var
40+
translationKeyMap[key] = value
41+
return value
42+
}
43+
3844
v.SetDefault(key, defaultValue)
3945
translationKeyMap[key] = v.GetString(key)
4046
return translationKeyMap[key]

0 commit comments

Comments
 (0)