Code Monkey home page Code Monkey logo

Comments (2)

corcus avatar corcus commented on May 24, 2024 3

You have understood my goal correctly.

I will read into the issue you provided. It does seem interesting.
In the meantime I have found a workaround. Instead of using the mustache syntax {{}} which interprets the data as plain text I use the v-html directive.
<div v-html='$t("label_result")'></div>

Now I get the correct result

Thanks for your response and the useful link

from vuex-i18n.

tikiatua avatar tikiatua commented on May 24, 2024

Hi @corcus

This sounds like an interesting problem. I do need some clarification to help you with this. So if I understand you correctly, you basically want to specify translations with special non ascii characters and the result should be the text string but not encoded in ascii.

Vue.i18n.add('es', {
    'label_result': 'résultat'
});

{{ $t('label_result') }} 
// should result in: résultat

Doing this in the test file, that we have in this repository does return the string correctly without special character encoding. Therefore I would deduct that the reason for your problem is (a) the razor template engine is encoding the string in ascii or (b) the file format is not in utf-8 and the server or an intermediate parser does some magic to encode the string in ascii.

A quick search for a problem with automatic encoding of non ascii characters in razor points towards this issue aspnet/HttpAbstractions#315 from which I would take the automatic encoding could be due to the XSS-protection enabled in the razor engine. Probably worth to take a closer look at this.

Please let me know if this is of any help – P.S. this is why we use golang for server side stuff. Less magic can sometimes be helpful ;-)

from vuex-i18n.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.