Translation of a dynamic site into Arabic in C #

I am currently facing the problem of a disgusting problem on a large website with several languages. Upon arrival to the website, it determines which country you are in and invites you to confirm this. Upon confirmation, it reduces the languages โ€‹โ€‹of the pages from the database and displays the corresponding language. This is done using jQuery. Now the problem is that Arabic reads rtl, so I need to either:

- replace the stylesheets for the rtl version

or

- change the HTML tag and include the attribute "dir = 'rtl" arritribute

Now I tried both of them, with errors on both. When I look at the source of the page, it still shows the old Css file or HTML tag without the "dir" attribute. Correct me if I am mistaken, but I believe that this is due to the fact that the DOM does not register new changes, as they occurred asynchronously through jQuery after creating the DOM.

After all this blah blah and TL; DR;
Is there an easier way to dynamically change the direction of the text? If this is a DOM problem, how can I reload the DOM after an asynchronous callback?

I was in this issue for hours, and I was very lucky at interwebz.

Any help is appreciated and greatly appreciated.

Yours faithfully,

William francis

EDIT:

After much research, I found that the only way to truly work in Arabic is from the other side. Once the language has been selected, you do the postback, and then the process of changing the HREF style attribute from the code behind is simply simple. It seems that there is no form of JavaScript or jQuery that can change it without writing back and still reflect the new stylesheet. NOTE. You need to set the HREF style sheet for each post back, that is, through the main page. Stylsheet changes are not saved on different pages.

Here is a website that has helped a lot and explained a lot about styles using JavaScript. Unfortunately, this did not work for me.

http://www.alistapart.com/articles/alternate/

+4
source share
1 answer

There may be several things. I found this page very useful when dealing with a similar one, so I highly recommend:

http://www.w3.org/International/tutorials/bidi-xhtml/

Also, if you are not already doing this, use the Firebug tool to check the generated DOM after starting AJAX to make sure you see the changed state of the DOM, not the source of the page. You can dynamically change the speaker - you can use Firebug to add a new attribute to the HTML tag of this page (set dir = "rtl") to see how it changes dynamically. Perhaps some other element redefines direction, it is possible that AJAX changes are not loading correctly, or other things. If you can post more of your code, it would be helpful to give a better answer, but I hope this helps.

0
source

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


All Articles