Skip to content

Commit

Permalink
Localized strings for EditorFile #377
Browse files Browse the repository at this point in the history
  • Loading branch information
vanjac committed Jan 14, 2024
1 parent c1e24fa commit f7e00da
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 16 deletions.
23 changes: 7 additions & 16 deletions Assets/VoxelEditor/EditorFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ private IEnumerator LoadCoroutine()
{
var dialog = guiGameObject.AddComponent<DialogGUI>();
dialog.message = e.FullMessage;
dialog.yesButtonText = "Close";
dialog.yesButtonText = GUIPanel.StringSet.Close;
dialog.yesButtonHandler = () =>
{
voxelArray.unsavedChanges = false;
Expand All @@ -67,15 +67,8 @@ private IEnumerator LoadCoroutine()
lastVersion = lastVersion.Substring(0, lastVersion.Length - 1);
if (CompareVersions(lastVersion, "1.3.5") == -1)
{
LargeMessageGUI.ShowLargeMessageDialog(guiGameObject, "N-Space has been updated!"
+ " Check out the <b>Doors</b> Demo World in the help menu to see the new features.\n\n"
+ "• New <b>Scale</b> behavior to change size of objects/substances\n"
+ "• You can change the <b>Pivot</b> point of substances for rotation/scaling\n"
+ "• Lights are visible in the editor, even when not selected\n"
+ "• Objects can be placed inside walls or outside bounds\n"
+ "• Fixed lag caused by larger substances\n"
+ "• Button in the bottom right toggles pan/orbit with two fingers\n"
+ "... and some more improvements / fixes!");
LargeMessageGUI.ShowLargeMessageDialog(guiGameObject,
GUIPanel.StringSet.UpdateMessage_1_3_5);
}
}
PlayerPrefs.SetString("last_editScene_version", Application.version);
Expand All @@ -86,7 +79,7 @@ private IEnumerator LoadCoroutine()
// for some reason it's necessary to wait two frames
yield return null;
yield return null;
string message = "There were some issues with reading the world:\n\n" +
string message = GUIPanel.StringSet.WorldWarningsHeader + "\n\n" +
string.Join("\n", warnings.ToArray());
LargeMessageGUI.ShowLargeMessageDialog(guiGameObject, message);
}
Expand Down Expand Up @@ -146,10 +139,7 @@ public bool Save(bool allowPopups = true)
{
if (allowPopups)
{
string message = "An error occurred while saving the file. "
+ "Please send me an email about this, and include a screenshot "
+ "of this message. chroma@chroma.zone\n\n"
+ e.ToString();
string message = GUIPanel.StringSet.UnknownSaveError + e.ToString();
var dialog = LargeMessageGUI.ShowLargeMessageDialog(GUIPanel.GuiGameObject, message);
dialog.closeHandler = () => SceneManager.LoadScene(Scenes.MENU);
voxelArray.unsavedChanges = false;
Expand Down Expand Up @@ -212,7 +202,8 @@ void OnApplicationPause(bool pauseStatus)
}
catch (System.Exception e)
{
DialogGUI.ShowMessageDialog(GUIPanel.GuiGameObject, "An error occurred while reading the file.");
DialogGUI.ShowMessageDialog(GUIPanel.GuiGameObject,
GUIPanel.StringSet.UnknownReadError);
Debug.LogError(e);
stream?.Dispose();
ShareMap.ClearFileWaitingToImport();
Expand Down
20 changes: 20 additions & 0 deletions Assets/VoxelEditor/GUI/localization/GUIStringSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,14 @@ public class GUIStringSet
public virtual string AddInput =>
"Add Input";

// Editor errors
public virtual string WorldWarningsHeader =>
"There were some issues with reading the world:";
public virtual string UnknownSaveError =>
"An error occurred while saving the file. Please send me an email about this, and include a screenshot of this message. chroma@chroma.zone\n\n";
public virtual string UnknownReadError =>
"An error occurred while reading the file.";

// Help menu
public virtual string HelpMenuTitle =>
"Help";
Expand Down Expand Up @@ -552,4 +560,16 @@ public class GUIStringSet
"<i>Play your game. Try jumping in the pit.</i>";
public virtual string TutorialPitBalls =>
"<i>Now try making some balls with Physics behaviors. Then play the game and push them all into the pit.</i> Enjoy.";

// Update messages
public virtual string UpdateMessage_1_3_5 =>
@"N-Space has been updated! Check out the <b>Doors</b> Demo World in the help menu to see the new features.
• New <b>Scale</b> behavior to change size of objects/substances
• You can change the <b>Pivot</b> point of substances for rotation/scaling
• Lights are visible in the editor, even when not selected
• Objects can be placed inside walls or outside bounds
• Fixed lag caused by larger substances
• Button in the bottom right toggles pan/orbit with two fingers
... and some more improvements / fixes!";
}

0 comments on commit f7e00da

Please sign in to comment.