[gnome-games/wip/exalm/strings: 1/3] ui: Rename backup to export, restore to import



commit 585d2ac7866f75dea6149ec89e26cff490c49df3
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Sat Jan 25 20:40:11 2020 +0500

    ui: Rename backup to export, restore to import
    
    The previous terms weren't easily translatable, and it should be clearer
    overall.

 data/org.gnome.Games.gresource.xml                 |  2 +-
 ...estore.ui => preferences-page-import-export.ui} | 18 +++++++-------
 data/ui/preferences-window.ui                      |  2 +-
 src/meson.build                                    |  2 +-
 src/ui/application.vala                            |  4 ++--
 ...re.vala => preferences-page-import-export.vala} | 28 +++++++++++-----------
 6 files changed, 28 insertions(+), 28 deletions(-)
---
diff --git a/data/org.gnome.Games.gresource.xml b/data/org.gnome.Games.gresource.xml
index d157b0a0..2a516c3f 100644
--- a/data/org.gnome.Games.gresource.xml
+++ b/data/org.gnome.Games.gresource.xml
@@ -33,7 +33,7 @@
     <file preprocess="xml-stripblanks">ui/platform-list-item.ui</file>
     <file preprocess="xml-stripblanks">ui/preferences-page.ui</file>
     <file preprocess="xml-stripblanks">ui/preferences-page-controllers.ui</file>
-    <file preprocess="xml-stripblanks">ui/preferences-page-backup-restore.ui</file>
+    <file preprocess="xml-stripblanks">ui/preferences-page-import-export.ui</file>
     <file preprocess="xml-stripblanks">ui/preferences-page-platforms.ui</file>
     <file preprocess="xml-stripblanks">ui/preferences-page-platforms-generic-row.ui</file>
     <file preprocess="xml-stripblanks">ui/preferences-page-platforms-retro-row.ui</file>
diff --git a/data/ui/preferences-page-backup-restore.ui b/data/ui/preferences-page-import-export.ui
similarity index 83%
rename from data/ui/preferences-page-backup-restore.ui
rename to data/ui/preferences-page-import-export.ui
index 4ff7e4cc..c282b555 100644
--- a/data/ui/preferences-page-backup-restore.ui
+++ b/data/ui/preferences-page-import-export.ui
@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <requires lib="gtk+" version="3.24"/>
-  <template class="GamesPreferencesPageBackupRestore" parent="GamesPreferencesPage">
+  <template class="GamesPreferencesPageImportExport" parent="GamesPreferencesPage">
     <property name="visible">True</property>
     <child>
       <object class="GtkLabel">
         <property name="visible">True</property>
         <property name="xalign">0</property>
-        <property name="label" translatable="yes">Backup save states and in-game saves. This can be used for 
moving the data to another device or for restoring it later. Desktop, Steam and LÖVE games cannot be backed 
up.</property>
+        <property name="label" translatable="yes">Export save states and in-game saves. This can be used for 
moving the data to another device or for restoring it later. Desktop, Steam and LÖVE games cannot be 
exported.</property>
         <property name="wrap">True</property>
         <style>
           <class name="dim-label"/>
@@ -39,7 +39,7 @@
                     <property name="visible">True</property>
                     <property name="xalign">0</property>
                     <property name="expand">True</property>
-                    <property name="label" translatable="yes">Back up save data</property>
+                    <property name="label" translatable="yes">Export save data</property>
                     <property name="ellipsize">end</property>
                   </object>
                 </child>
@@ -48,8 +48,8 @@
                     <property name="visible">True</property>
                     <property name="can-focus">True</property>
                     <property name="use-underline">True</property>
-                    <property name="label" translatable="yes">_Back Up</property>
-                    <signal name="clicked" handler="on_backup_clicked"/>
+                    <property name="label" translatable="yes">_Export</property>
+                    <signal name="clicked" handler="on_export_clicked"/>
                   </object>
                 </child>
               </object>
@@ -63,7 +63,7 @@
         <property name="visible">True</property>
         <property name="xalign">0</property>
         <property name="margin-top">12</property>
-        <property name="label" translatable="yes">Restore save data for games from existing backup. This 
will replace existing saves and cannot be undone.</property>
+        <property name="label" translatable="yes">Import save data for games from existing backup. This will 
replace existing saves and cannot be undone.</property>
         <property name="wrap">True</property>
         <style>
           <class name="dim-label"/>
@@ -94,7 +94,7 @@
                     <property name="visible">True</property>
                     <property name="xalign">0</property>
                     <property name="expand">True</property>
-                    <property name="label" translatable="yes">Restore save data</property>
+                    <property name="label" translatable="yes">Import save data</property>
                     <property name="ellipsize">end</property>
                   </object>
                 </child>
@@ -103,8 +103,8 @@
                     <property name="visible">True</property>
                     <property name="can-focus">True</property>
                     <property name="use-underline">True</property>
-                    <property name="label" translatable="yes">_Restore</property>
-                    <signal name="clicked" handler="on_restore_clicked"/>
+                    <property name="label" translatable="yes">_Import</property>
+                    <signal name="clicked" handler="on_import_clicked"/>
                     <style>
                       <class name="destructive-action"/>
                     </style>
diff --git a/data/ui/preferences-window.ui b/data/ui/preferences-window.ui
index 39e6c3b5..5722830b 100644
--- a/data/ui/preferences-window.ui
+++ b/data/ui/preferences-window.ui
@@ -149,7 +149,7 @@
                   </object>
                 </child>
                 <child>
-                  <object class="GamesPreferencesPageBackupRestore" id="backup_restore_page">
+                  <object class="GamesPreferencesPageImportExport" id="import_export_page">
                     <property name="visible">True</property>
                   </object>
                 </child>
diff --git a/src/meson.build b/src/meson.build
index a0444563..df50454f 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -133,7 +133,7 @@ vala_sources = [
   'ui/platforms-view.vala',
   'ui/preferences-page.vala',
   'ui/preferences-page-controllers.vala',
-  'ui/preferences-page-backup-restore.vala',
+  'ui/preferences-page-import-export.vala',
   'ui/preferences-page-platforms.vala',
   'ui/preferences-page-platforms-generic-row.vala',
   'ui/preferences-page-platforms-retro-row.vala',
diff --git a/src/ui/application.vala b/src/ui/application.vala
index 802d26b1..a343e428 100644
--- a/src/ui/application.vala
+++ b/src/ui/application.vala
@@ -440,14 +440,14 @@ public class Games.Application : Gtk.Application {
                device.absolute_axis_event.connect (on_gamepad_absolute_axis_event);
        }
 
-       public static void restore_from (string archive_path) throws ExtractionError {
+       public static void import_from (string archive_path) throws ExtractionError {
                var data_dir = Application.get_data_dir ();
                string[] database = { Application.get_database_path () };
 
                FileOperations.extract_archive (archive_path, data_dir, database);
        }
 
-       public static void backup_to (string file_path) throws CompressionError {
+       public static void export_to (string file_path) throws CompressionError {
                var data_dir = File.new_for_path (Application.get_data_dir ());
                string[] database = { Application.get_database_path () };
 
diff --git a/src/ui/preferences-page-backup-restore.vala b/src/ui/preferences-page-import-export.vala
similarity index 53%
rename from src/ui/preferences-page-backup-restore.vala
rename to src/ui/preferences-page-import-export.vala
index 8d8fc349..57c8f5f3 100644
--- a/src/ui/preferences-page-backup-restore.vala
+++ b/src/ui/preferences-page-import-export.vala
@@ -1,26 +1,26 @@
 // This file is part of GNOME Games. License: GPL-3.0+.
 
-[GtkTemplate (ui = "/org/gnome/Games/ui/preferences-page-backup-restore.ui")]
-private class Games.PreferencesPageBackupRestore : PreferencesPage {
+[GtkTemplate (ui = "/org/gnome/Games/ui/preferences-page-import-export.ui")]
+private class Games.PreferencesPageImportExport : PreferencesPage {
        construct {
-               title = _("Back Up & Restore");
+               title = _("Import & Export");
        }
 
        [GtkCallback]
-       private void on_restore_clicked () {
+       private void on_import_clicked () {
                var toplevel = get_toplevel () as Gtk.Window;
-               var chooser = new Gtk.FileChooserNative (_("Restore save data"), toplevel,
+               var chooser = new Gtk.FileChooserNative (_("Import save data"), toplevel,
                                                         Gtk.FileChooserAction.OPEN,
-                                                        _("_Restore"), _("_Cancel"));
+                                                        _("_Import"), _("_Cancel"));
 
                if (chooser.run () == Gtk.ResponseType.ACCEPT) {
                        var archive_name = chooser.get_filename ();
 
                        try {
-                               Application.restore_from (archive_name);
+                               Application.import_from (archive_name);
                        }
                        catch (ExtractionError e) {
-                               var msg = _("Couldn’t restore: %s").printf (e.message);
+                               var msg = _("Couldn’t import save data: %s").printf (e.message);
                                show_error_message (msg);
                        }
                }
@@ -29,17 +29,17 @@ private class Games.PreferencesPageBackupRestore : PreferencesPage {
        }
 
        [GtkCallback]
-       private void on_backup_clicked () {
+       private void on_export_clicked () {
                var toplevel = get_toplevel () as Gtk.Window;
-               var chooser = new Gtk.FileChooserNative (_("Back up save data"), toplevel,
+               var chooser = new Gtk.FileChooserNative (_("Export save data"), toplevel,
                                                        Gtk.FileChooserAction.SAVE,
-                                                       _("_Back Up"), _("_Cancel"));
+                                                       _("_Export"), _("_Cancel"));
 
                chooser.do_overwrite_confirmation = true;
 
                var current_time = new DateTime.now_local ();
                var creation_time = current_time.format ("%c");
-               var archive_filename = "gnome-games-backup-%s.tar.gz".printf (creation_time);
+               var archive_filename = "gnome-games-save-data-%s.tar.gz".printf (creation_time);
 
                chooser.set_current_name (archive_filename);
 
@@ -47,10 +47,10 @@ private class Games.PreferencesPageBackupRestore : PreferencesPage {
                        var filename = chooser.get_filename ();
 
                        try {
-                               Application.backup_to (filename);
+                               Application.export_to (filename);
                        }
                        catch (CompressionError e) {
-                               var msg = _("Couldn’t back up: %s").printf (e.message);
+                               var msg = _("Couldn’t export save data: %s").printf (e.message);
                                show_error_message (msg);
                        }
                }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]