Computable-Finance / CoFiX-Web-User-Interface-V2.0

CoFiX Web User Interface
https://cofix.io/
MIT License
4 stars 1 forks source link

Replace # in the URL with language version #86

Open colourfreak opened 3 years ago

colourfreak commented 3 years ago

Currently, we have: https://cofix.io/#/income

What is the # made for?

Can we instead add a language version there. Something like https://cofix.io/en/income and https://cofix.io/zn/income Let me explain why this is important to me. In Google Analytics I need to know which version is used. And I can't make filters for each subcategory /zn/ or /en/. Knowing in which language users can't complete a goal is very useful. If we would be able to find that 10% completed a goal on the English version vs 50% completed the same goal in the Chinese version. Maybe there is a problem with the translation then.

https://www.datadrivenu.com/multilingual-tracking-google-analytics/

Here is a tutorial on how to set this up. I don't know what is regex.

foxgem commented 3 years ago

This is a kind of sharp url first used by twitter if my memory not wrong. We can use it to support browser history for a SPA.

We could not use locale as a part of url because all translation is handled by code not by something like static files.

Google Analytics should have some links to help us to know where uses from.

foxgem commented 3 years ago

My bad, it seemed that we can use some angular router tricks to implement that. I will assign this issue to me, thanks.

foxgem commented 3 years ago

we tried several methods to implement this issue, but not very successful: we could make url show locale info in browser, but if refreshing current page, 404 will be returned.

The reason is # used by the internal (that is web server will still use # ), changing browser representation will not effect on it. When refreshing, the url sent by browser will be unknown to server.