Permalink
Browse files

bug: Solves problem with quotation marks in MaterialTranslate

  • Loading branch information...
MikeMitterer committed Nov 3, 2017
1 parent 781efc0 commit 2e99ca1cecb0996e0a663f71c21827781619fca4
Showing with 10 additions and 1 deletion.
  1. +10 −1 lib/src/directive/components/MaterialTranslate.dart
@@ -86,9 +86,18 @@ class MaterialTranslate extends MdlComponent {
element.classes.add(_MaterialTranslateConstant.WIDGET_SELECTOR);
/*final String translation =*/ element.text.replaceFirstMapped(
new RegExp('(_|l10n|L10N)\\((\'|\")([^\"\']*)(\'|\")\\)'),
new RegExp(
'(_|l10n|L10N)(\\(\'|\\(\")'
'(.*)'
'(\'\\)|\"\\))'),
(final Match match) {
_idToTranslate = match.group(3).trim();
/*
for(int i = 1;i <= match.groupCount;i++) {
_logger.info(match[i]);
}
_logger.info("......................................");
*/
//return translator.translate(new L10N(_idToTranslate));
});

0 comments on commit 2e99ca1

Please sign in to comment.