crowdin: Fix for devicesettings

* Due to a split at /res, the devicesettings-repo was always treated wrong
* Check the length of the list after split and treat that case properly

Change-Id: I43f96a84142a0c2df4ab66a0b91a9ed08e0be1a1
diff --git a/crowdin_sync.py b/crowdin_sync.py
index d191af1..d69fc98 100755
--- a/crowdin_sync.py
+++ b/crowdin_sync.py
@@ -435,7 +435,19 @@
             print('WARNING: Cannot determine project root dir of '
                   '[%s], skipping.' % path)
             continue
-        result = path.split('/res')[0].strip('/')
+
+        # Usually the project root is everything before /res
+        # but there are special cases where /res is part of the repo name as well
+        parts = path.split("/res")
+        if len(parts) == 2:
+            result = parts[0]
+        elif len(parts) == 3:
+            result = parts[0] + '/res' + parts[1]
+        else:
+            print('WARNING: Splitting the path not successful for [%s], skipping' % path)
+            continue
+
+        result = result.strip('/')
         if result == path.strip('/'):
             print('WARNING: Cannot determine project root dir of '
                   '[%s], skipping.' % path)