Commits

Ratnadeep Debnath  committed e772c83

Added support in Apple strings handler for //... style comments in Apple strings file.

  • Participants
  • Parent commits d2043c1

Comments (0)

Files changed (7)

File transifex/resources/formats/strings.py

         #regex for finding all comments in a file
         cp = r'(?:/\*(?P<comment>(?:[^*]|(?:\*+[^*/]))*\**)\*/)'
         p = re.compile(r'(?:%s[ \t]*[\n]|[\r\n]|[\r]){0,1}(?P<line>(("(?P<key>[^"\\]*(?:\\.[^"\\]*)*)")|(?P<property>\w+))\s*=\s*"(?P<value>[^"\\]*(?:\\.[^"\\]*)*)"\s*;)'%cp, re.DOTALL|re.U)
-        c = re.compile(r'\s*/\*(.|\s)*?\*/\s*', re.U)
+        #c = re.compile(r'\s*/\*(.|\s)*?\*/\s*', re.U)
+        c = re.compile(r'//[^\n]*\n|/\*(?:.|[\r\n])*?\*/', re.U)
         ws = re.compile(r'\s+', re.U)
         buf = u""
         end=0

File transifex/resources/tests/lib/strings/test_translation.strings

Binary file modified.

File transifex/resources/tests/lib/strings/test_translation_compiled_for_review.strings

Binary file modified.

File transifex/resources/tests/lib/strings/test_translation_compiled_for_translation.strings

Binary file modified.

File transifex/resources/tests/lib/strings/test_translation_compiled_for_use.strings

Binary file modified.

File transifex/resources/tests/lib/strings/test_utf_16.strings

Binary file modified.

File transifex/resources/tests/lib/strings/test_utf_16_compiled.strings

Binary file modified.