Index: locale/en/mlx.po
===================================================================
--- locale/en/mlx.po	(revision 757)
+++ locale/en/mlx.po	(revision 759)
@@ -2143,9 +2143,18 @@
 "One of VATSIM ID or IVAO ID is mandatory."
 
-msgid "register_name"
-msgstr "_Name:"
-
-msgid "register_name_tooltip"
-msgstr "Enter your real name."
+msgid "register_name1"
+msgstr "First _name:"
+
+msgid "register_name1_tooltip"
+msgstr "Enter your real first name."
+
+msgid "register_name2"
+msgstr "Sur_name:"
+
+msgid "register_name2_tooltip"
+msgstr "Enter your real surname."
+
+msgid "register_nameorder"
+msgstr "western"
 
 msgid "register_year_of_birth"
Index: locale/hu/mlx.po
===================================================================
--- locale/hu/mlx.po	(revision 757)
+++ locale/hu/mlx.po	(revision 759)
@@ -2157,9 +2157,18 @@
 "Vagy VATSIM vagy IVAO azonosítót meg kell adni."
 
-msgid "register_name"
-msgstr "Né_v:"
-
-msgid "register_name_tooltip"
-msgstr "Írd be a valódi nevedet"
+msgid "register_name1"
+msgstr "_Vezetéknév:"
+
+msgid "register_name1_tooltip"
+msgstr "Írd be a valódi vezetéknevedet"
+
+msgid "register_name2"
+msgstr "Keresz_tnév:"
+
+msgid "register_name2_tooltip"
+msgstr "Írd be a valódi keresztnevedet"
+
+msgid "register_nameorder"
+msgstr "eastern"
 
 msgid "register_year_of_birth"
Index: src/mlx/gui/flight.py
===================================================================
--- src/mlx/gui/flight.py	(revision 756)
+++ src/mlx/gui/flight.py	(revision 759)
@@ -11,5 +11,5 @@
 import mlx.util as util
 from mlx.pirep import PIREP
-from mlx.i18n import xstr
+from mlx.i18n import xstr, getLanguage
 from mlx.sound import startSound
 import mlx.web as web
@@ -942,5 +942,5 @@
                                   xscale = 0.0, yscale = 0.0)
 
-        table = gtk.Table(11, 3)
+        table = gtk.Table(12, 3)
         table.set_row_spacings(4)
         table.set_col_spacings(32)
@@ -948,17 +948,37 @@
         self.setMainWidget(alignment)
 
+        row = 0
+
         labelAlignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,
                                        xscale = 0.0, yscale = 0.0)
-        label = gtk.Label(xstr("register_name"))
+        label = gtk.Label(xstr("register_name1"))
         label.set_use_underline(True)
         labelAlignment.add(label)
-        table.attach(labelAlignment, 0, 1, 0, 1)
-
-        self._name = gtk.Entry()
-        self._name.connect("changed", self._updateButtons)
-        self._name.set_tooltip_text(xstr("register_name_tooltip"))
-        self._name.set_width_chars(30)
-        table.attach(self._name, 1, 2, 0, 1)
-        label.set_mnemonic_widget(self._name)
+        table.attach(labelAlignment, 0, 1, row, row+1)
+
+        self._name1 = gtk.Entry()
+        self._name1.connect("changed", self._updateButtons)
+        self._name1.set_tooltip_text(xstr("register_name1_tooltip"))
+        self._name1.set_width_chars(15)
+        table.attach(self._name1, 1, 2, row, row+1)
+        label.set_mnemonic_widget(self._name1)
+
+        row += 1
+
+        labelAlignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,
+                                       xscale = 0.0, yscale = 0.0)
+        label = gtk.Label(xstr("register_name2"))
+        label.set_use_underline(True)
+        labelAlignment.add(label)
+        table.attach(labelAlignment, 0, 1, row, row+1)
+
+        self._name2 = gtk.Entry()
+        self._name2.connect("changed", self._updateButtons)
+        self._name2.set_tooltip_text(xstr("register_name2_tooltip"))
+        self._name2.set_width_chars(15)
+        table.attach(self._name2, 1, 2, row, row+1)
+        label.set_mnemonic_widget(self._name2)
+
+        row += 1
 
         labelAlignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,
@@ -967,5 +987,5 @@
         label.set_use_underline(True)
         labelAlignment.add(label)
-        table.attach(labelAlignment, 0, 1, 1, 2)
+        table.attach(labelAlignment, 0, 1, row, row+1)
 
         alignment = gtk.Alignment(xalign = 0.0, yalign = 0.0,
@@ -982,6 +1002,8 @@
         self._yearOfBirth.connect("value-changed", self._updateButtons)
         alignment.add(self._yearOfBirth)
-        table.attach(alignment, 1, 2, 1, 2)
+        table.attach(alignment, 1, 2, row, row+1)
         label.set_mnemonic_widget(self._yearOfBirth)
+
+        row += 1
 
         labelAlignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,
@@ -990,10 +1012,10 @@
         label.set_use_underline(True)
         labelAlignment.add(label)
-        table.attach(labelAlignment, 0, 1, 2, 3)
+        table.attach(labelAlignment, 0, 1, row, row+1)
 
         self._emailAddress = gtk.Entry()
         self._emailAddress.connect("changed", self._updateButtons)
         self._emailAddress.set_tooltip_text(xstr("register_email_tooltip"))
-        table.attach(self._emailAddress, 1, 2, 2, 3)
+        table.attach(self._emailAddress, 1, 2, row, row+1)
         label.set_mnemonic_widget(self._emailAddress)
 
@@ -1001,5 +1023,7 @@
         self._emailAddressPublic.set_use_underline(True)
         self._emailAddressPublic.set_tooltip_text(xstr("register_email_public_tooltip"))
-        table.attach(self._emailAddressPublic, 2, 3, 2, 3)
+        table.attach(self._emailAddressPublic, 2, 3, row, row+1)
+
+        row += 1
 
         labelAlignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,
@@ -1008,5 +1032,5 @@
         label.set_use_underline(True)
         labelAlignment.add(label)
-        table.attach(labelAlignment, 0, 1, 3, 4)
+        table.attach(labelAlignment, 0, 1, row, row+1)
 
         alignment = gtk.Alignment(xalign = 0.0, yalign = 0.0,
@@ -1017,6 +1041,8 @@
         self._vatsimID.set_width_chars(7)
         alignment.add(self._vatsimID)
-        table.attach(alignment, 1, 2, 3, 4)
+        table.attach(alignment, 1, 2, row, row+1)
         label.set_mnemonic_widget(self._vatsimID)
+
+        row += 1
 
         labelAlignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,
@@ -1025,5 +1051,5 @@
         label.set_use_underline(True)
         labelAlignment.add(label)
-        table.attach(labelAlignment, 0, 1, 4, 5)
+        table.attach(labelAlignment, 0, 1, row, row+1)
 
         alignment = gtk.Alignment(xalign = 0.0, yalign = 0.0,
@@ -1034,6 +1060,8 @@
         self._ivaoID.set_width_chars(7)
         alignment.add(self._ivaoID)
-        table.attach(alignment, 1, 2, 4, 5)
+        table.attach(alignment, 1, 2, row, row+1)
         label.set_mnemonic_widget(self._ivaoID)
+
+        row += 1
 
         labelAlignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,
@@ -1043,10 +1071,12 @@
         label.set_use_markup(True)
         labelAlignment.add(label)
-        table.attach(labelAlignment, 0, 1, 5, 6)
+        table.attach(labelAlignment, 0, 1, row, row+1)
 
         self._phoneNumber = gtk.Entry()
         self._phoneNumber.set_tooltip_text(xstr("register_phone_num_tooltip"))
-        table.attach(self._phoneNumber, 1, 2, 5, 6)
+        table.attach(self._phoneNumber, 1, 2, row, row+1)
         label.set_mnemonic_widget(self._phoneNumber)
+
+        row += 1
 
         labelAlignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,
@@ -1056,10 +1086,10 @@
         label.set_use_markup(True)
         labelAlignment.add(label)
-        table.attach(labelAlignment, 0, 1, 6, 7)
+        table.attach(labelAlignment, 0, 1, row, row+1)
 
 
         self._nationality = gtk.Entry()
         self._nationality.set_tooltip_text(xstr("register_nationality_tooltip"))
-        table.attach(self._nationality, 1, 2, 6, 7)
+        table.attach(self._nationality, 1, 2, row, row+1)
         label.set_mnemonic_widget(self._nationality)
 
@@ -1069,5 +1099,7 @@
         placeholder.set_child_visible(False)
         placeholder.hide()
-        table.attach(placeholder, 2, 3, 6, 7)
+        table.attach(placeholder, 2, 3, row, row+1)
+
+        row += 1
 
         labelAlignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,
@@ -1076,5 +1108,5 @@
         label.set_use_underline(True)
         labelAlignment.add(label)
-        table.attach(labelAlignment, 0, 1, 8, 9)
+        table.attach(labelAlignment, 0, 1, row, row+1)
 
         self._password = gtk.Entry()
@@ -1082,5 +1114,5 @@
         self._password.connect("changed", self._updateButtons)
         self._password.set_tooltip_text(xstr("register_password_tooltip"))
-        table.attach(self._password, 1, 2, 8, 9)
+        table.attach(self._password, 1, 2, row, row+1)
         label.set_mnemonic_widget(self._password)
 
@@ -1089,5 +1121,7 @@
         self._passwordStatus = gtk.Label()
         alignment.add(self._passwordStatus)
-        table.attach(alignment, 2, 3, 8, 9)
+        table.attach(alignment, 2, 3, row, row+1)
+
+        row += 1
 
         labelAlignment = gtk.Alignment(xalign = 1.0, yalign = 0.5,
@@ -1096,5 +1130,5 @@
         label.set_use_underline(True)
         labelAlignment.add(label)
-        table.attach(labelAlignment, 0, 1, 9, 10)
+        table.attach(labelAlignment, 0, 1, row, row+1)
 
         self._password2 = gtk.Entry()
@@ -1102,5 +1136,5 @@
         self._password2.connect("changed", self._updateButtons)
         self._password2.set_tooltip_text(xstr("register_password2_tooltip"))
-        table.attach(self._password2, 1, 2, 9, 10)
+        table.attach(self._password2, 1, 2, row, row+1)
         label.set_mnemonic_widget(self._password2)
 
@@ -1109,10 +1143,12 @@
         self._password2Status = gtk.Label()
         alignment.add(self._password2Status)
-        table.attach(alignment, 2, 3, 9, 10)
+        table.attach(alignment, 2, 3, row, row+1)
+
+        row += 1
 
         self._rememberButton = gtk.CheckButton(xstr("remember_password"))
         self._rememberButton.set_use_underline(True)
         self._rememberButton.set_tooltip_text(xstr("login_remember_tooltip"))
-        table.attach(self._rememberButton, 1, 2, 10, 11)
+        table.attach(self._rememberButton, 1, 2, row, row+1)
 
         cancelButton = \
@@ -1128,7 +1164,12 @@
 
     @property
-    def name(self):
-        """Get the name entered."""
-        return self._name.get_text()
+    def name1(self):
+        """Get the first name component entered."""
+        return self._name1.get_text()
+
+    @property
+    def name2(self):
+        """Get the second name component entered."""
+        return self._name2.get_text()
 
     @property
@@ -1186,8 +1227,4 @@
     def _updateButtons(self, widget = None):
         """Update the sensitive state of the buttons"""
-        name = self.name
-        nameLength = len(name)
-        nameSpacePosition = name.find(" ")
-
         yearOfBirth = self.yearOfBirth
 
@@ -1217,6 +1254,5 @@
 
         sensitive = \
-            nameLength >= 5 and nameSpacePosition != -1 and \
-            nameSpacePosition<(nameLength-2) and \
+            len(self.name1)>0 and len(self.name2)>0 and \
             yearOfBirth>=RegisterPage._minYearOfBirth and \
             yearOfBirth<=RegisterPage._maxYearOfBirth and \
@@ -1233,5 +1269,24 @@
     def _registerClicked(self, button):
         """Called when the Register button is clicked."""
-        registrationData = web.Registration(self.name, self.yearOfBirth,
+        nameOrder = xstr("register_nameorder")
+
+        if nameOrder=="eastern":
+            surName = self.name1
+            firstName = self.name2
+        else:
+            surName = self.name2
+            firstName = self.name1
+
+        nationality = self.nationality.lower()
+
+        if getLanguage().lower()=="hu" or nationality.find("hung")!=-1 or \
+           nationality.find("magyar")!=-1:
+            requestedNameOrder = "eastern"
+        else:
+            requestedNameOrder = "western"
+
+        registrationData = web.Registration(surName, firstName,
+                                            requestedNameOrder,
+                                            self.yearOfBirth,
                                             self.emailAddress,
                                             self.emailAddressPublic,
@@ -1240,5 +1295,5 @@
                                             self.password)
         print "Registering with data:"
-        print "  name:", self.name, registrationData.name
+        print "  name:", self.name1, self.name2, registrationData.firstName, registrationData.surName, requestedNameOrder
         print "  yearOfBirth:", self.yearOfBirth, registrationData.yearOfBirth
         print "  emailAddress:", self.emailAddress, registrationData.emailAddress
Index: src/mlx/rpc.py
===================================================================
--- src/mlx/rpc.py	(revision 756)
+++ src/mlx/rpc.py	(revision 759)
@@ -127,8 +127,11 @@
 class Registration(object):
     """Data for registration."""
-    def __init__(self, name, yearOfBirth, emailAddress, emailAddressPublic,
+    def __init__(self, surName, firstName, nameOrder,
+                 yearOfBirth, emailAddress, emailAddressPublic,
                  vatsimID, ivaoID, phoneNumber, nationality, password):
         """Construct the registration data."""
-        self.name = name
+        self.surName = surName
+        self.firstName = firstName
+        self.nameOrder = nameOrder
         self.yearOfBirth = yearOfBirth
         self.emailAddress = emailAddress
