Polymer Symbol Dart Lang

I wrote a fragment and did not work with national characters. The text "A törzsszám" ... appears "törzsszám" with my loginstatus field.

The main html:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="hu" xml:lang="en">
  <head>
  <meta charset="utf-8">
....

login.html

<polymer-element name="login-element" attributes="loginrow">
  <template>
    ...
    <div>
      <input type="text" value="{{torzsszam}}">
      ...
      <br>
      <span>({{loginstatus}})</span>
    </div>
  </template>
  <script type="application/dart" src="login.dart"></script>
</polymer-element>

.. and login.dart :

@CustomTag('login-element')
class Login extends PolymerElement {
  bool loginned = false;
  @published String torzsszam = "";
  @published String password = "";
  @published String loginstatus = "-";

  ...

  void log_in_click() {
    loginstatus="LOGIN";
    loginned = false;
    if (torzsszam != "" ) {
      if (torzsszam.length>8) {

        loginstatus='A törzsszám legfeljebb 8 számjegyből áll!';
      } else {

What can I do...

+1
source share
2 answers

Some time ago, I placed code for a tag <safe-html>in HTML tags inside internationalized lines in the Polymer.dart file (the original form Link content containing html tags )

Using this polymer element shows the correct characters.

login.html :

<link rel="import" href="../packages/safe_html/safe_html.html">

<polymer-element name="login-element" attributes="loginrow">
  <template>
    ...
    <div>
      <input type="text" value="{{torzsszam}}">
      ...
      <br>
      <span>(<safe-html model="{{loginstatus}}></safe-html>)</span>
    </div>
  </template>
  <script type="application/dart" src="login.dart"></script>
</polymer-element>
+1

,... :

1.solution: login.dart utf-8 ISO-8859-2

2.solution: (consts.dart)

class consts {
  static String loginstatus_err8 = "A törzsszám legfeljebb 8 számjegyből áll!";  
  static String loginstatus_OK = "Belépve";  
  static String loginstatus_emptytorzsszam = "A törzsszámot ki kell tölteni";
}

login.dart, :) .

...
        loginstatus=consts.loginstatus_err8;
      } else {

        loginstatus=consts.loginstatus_OK;
...
+2

Source: https://habr.com/ru/post/1524361/


All Articles