0

I am using angular 15.2.0, with angular universal, and angular localization..

I noticed one strange thing when prerendering the arabic version of the website,,

as known angular localization generate a separate version of your website for every localization supported.

I use arabic and english,, when prerendering both arabic and eglish websites are generated successfully.

English localized text is loaded into the HTML website, and English content coming from the API calls is loaded successfully as well during the prerender process.

In the Arabic version the problems happen, Arabic translated text is loaded successfully,, BUT Arabic text coming from the API call, is not loaded successfully, it shows as encrypted text.. check the below photo, these are the prerendered files, now when running the application on the server, it flashes this text (the encrypted one) then shows the correct text when running the scripts.

My qyestion is how to solve this issue,, and how to solve the flashing between showing the prerendered file and executing the scripts.

enter image description here

3
  • In production you should barely notice the "flashing" of the website when javascript takes over. But if it really bothers, angular 16 introduced hydration, which reuses the HTML elements that were generated during SSR Commented Jul 5, 2023 at 6:58
  • @Pieterjan sounds great,, I'll look into hydration,, I am so close to upgrade to 16 :). But I have to solve the Arabic thing first.. it is a show-stopper. Commented Jul 5, 2023 at 12:20
  • Fonts are loaded on demand. It's not because they are declared somewhere in a @font-face that they will be loaded immediately. you could test if it comes from that by specifying exact font size and weight as another one that is already loaded to check if it comes from that reason. Commented Oct 26, 2023 at 21:36

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.