Browse Source

Replaced hardcoded strings

CPKreuz 2 years ago
parent
commit
ddfd5b93c7

+ 8 - 2
src/PixiEditor/Data/Localization/Languages/en.json

@@ -549,5 +549,11 @@
   "COPY_TO_CLIPBOARD": "Copy to clipboard",
   "LANGUAGE_FILE_NOT_FOUND": "Language file not found.\nLooking for {0}",
   "PROJECT_ROOT_NOT_FOUND": "PixiEditor Project root not found.\nLooking for PixiEditor.csproj",
-  "LOCALIZATION_FOLDER_NOT_FOUND": "Localization folder not found.\nLooking for /Data/Localization"
-}
+  "LOCALIZATION_FOLDER_NOT_FOUND": "Localization folder not found.\nLooking for /Data/Localization",
+  "SELECT_A_LANGUAGE": "Select a language",
+  "DONE": "Done",
+  "SOURCE_UNSET_OR_MISSING": "Source missing/unset",
+  "SOURCE_NEWER": "Source newer",
+  "SOURCE_UP_TO_DATE": "Source is up to date",
+  "SOURCE_OLDER": "Cloud newer"
+}

+ 3 - 3
src/PixiEditor/Views/Dialogs/DebugDialogs/Localization/LocalizationDebugWindow.xaml

@@ -135,7 +135,7 @@
                                 </Style>
                             </ComboBox.ItemContainerStyle>
                         </ComboBox>
-                        <TextBlock Text="Select a language" Visibility="{Binding SelectedItem, ElementName=LanguageComboBox, Converter={converters:NullToVisibilityConverter}}"
+                        <TextBlock views:Translator.Key="SELECT_A_LANGUAGE" Visibility="{Binding SelectedItem, ElementName=LanguageComboBox, Converter={converters:NullToVisibilityConverter}}"
                                    Margin="5,0,0,0" VerticalAlignment="Center"
                                    IsHitTestVisible="False">
                         </TextBlock>
@@ -157,7 +157,7 @@
                             </TextBlock>
                             <TextBlock Grid.Column="1">
                                 <Run Text="{Binding SelectedLanguage.Percentage, Mode=OneWay, StringFormat='\{0\}%'}"/>
-                                <Run Text="Done"/>
+                                <Run views:Translator.Key="DONE"/>
                             </TextBlock>
                         </Grid>
                         <Grid Margin="0,0,0,5">
@@ -167,7 +167,7 @@
                                 <ColumnDefinition Width="Auto" />
                             </Grid.ColumnDefinitions>
                             <Border Background="{Binding SelectedLanguage.StatusBrush}" CornerRadius="2" />
-                            <TextBlock Grid.Column="1" Text="{Binding SelectedLanguage.StatusText}" Margin="5,0" />
+                            <TextBlock Grid.Column="1" views:Translator.LocalizedString="{Binding SelectedLanguage.StatusText}" Margin="5,0" />
                             <TextBlock Grid.Column="2" views:Translator.TooltipKey="COPY_TO_CLIPBOARD">
                                 <Hyperlink Command="{Binding CopySelectedUpdatedCommand}">
                                     <Run

+ 5 - 5
src/PixiEditor/Views/Dialogs/DebugDialogs/Localization/PoeLanguage.cs

@@ -43,12 +43,12 @@ public class PoeLanguage
             _ => throw new ArgumentOutOfRangeException()
         };
 
-        public string StatusText => Status switch
+        public LocalizedString StatusText => Status switch
         {
-            LanguageStatus.LocalMissing or LanguageStatus.LocalMin => "Source missing/unset",
-            LanguageStatus.LocalOlder => "Source older",
-            LanguageStatus.Equal => "Source up to date",
-            LanguageStatus.LocalNewer => "Source newer"
+            LanguageStatus.LocalMissing or LanguageStatus.LocalMin => new LocalizedString("SOURCE_UNSET_OR_MISSING"),
+            LanguageStatus.LocalOlder => new LocalizedString("SOURCE_NEWER"),
+            LanguageStatus.Equal => new LocalizedString("SOURCE_UP_TO_DATE"),
+            LanguageStatus.LocalNewer => new LocalizedString("SOURCE_OLDER")
         };
 
         private LanguageStatus Status => (l: LocalEquivalent?.LastUpdated, r: UpdatedUTC) switch