autoTranslate static method

String autoTranslate(
  1. String text
)

Implementation

static String autoTranslate(String text) {
  // log("You need to translate this text : " + text);
  at(text);

  try {
    List<String> texts = text.split("_");
    StringBuffer stringBuffer = StringBuffer();
    for (String singleText in texts) {
      stringBuffer
          .write("${singleText[0].toUpperCase()}${singleText.substring(1)} ");
    }
    String result = stringBuffer.toString();
    return result.substring(0, result.length - 1);
  } catch (err) {
    return text;
  }
}