apertium / apertium-html-tools

Web application providing a fully localised interface for text/website/document translation, analysis and generation powered by Apertium.
http://wiki.apertium.org/wiki/Apertium-html-tools
GNU General Public License v3.0
39 stars 90 forks source link

Add string replacements and the string in the about modal #422

Open Devesh21700Kumar opened 3 years ago

Devesh21700Kumar commented 3 years ago

The issue #361

1).Added the string and created a reference instance "More_Languages" in the eng.json file along with a replacement string "more_languages" to use the anchor tag.

2). Included it the tests as well

The changes represented below:-

image

I have added a logic to check the path of the route and conditionally render the string. I have also tested the same.

sushain97 commented 3 years ago

This seems like it would result in both beta.apertium.org and apertium.org having this string. That seems like a bit of a confusing UX?

Devesh21700Kumar commented 3 years ago

This seems like it would result in both beta.apertium.org and apertium.org having this string. That seems like a bit of a confusing UX?

I don't think that apertium.org would have the same string as beta.apertium.org has a separate string instance named More_Languages in the eng.json file. Also, even the text wrapped by the anchor tag is beta.apertium.org so I guess that won't be an issue at all.

sushain97 commented 3 years ago

Ah, my bad. I misread the implementation. In this case, how would beta.apertium.org avoid having this string entirely? It uses the same source tree as apertium.org.

Devesh21700Kumar commented 3 years ago

Ah, my bad. I misread the implementation. In this case, how would beta.apertium.org avoid having this string entirely? It uses the same source tree as apertium.org.

Yeah, this was something that I thought about as well. But then the main reason for using the string is to encapsulate the whole Looking for more languages? Try {{more_languages}} part in {{More_Languages}}.

Here {{more_languages}} is <a dangerouslySetInnerHTML={{ __html: 'beta.apertium.org' }} href='https://beta.apertium.org' rel='noreferrer' target='_blank'/>

and since this appeared quite modular I thought of going ahead with this implementation.

Devesh21700Kumar commented 2 years ago

Ah, my bad. I misread the implementation. In this case, how would beta.apertium.org avoid having this string entirely? It uses the same source tree as apertium.org.

Yeah, this was something that I thought about as well. But then the main reason for using the string is to encapsulate the whole Looking for more languages? Try {{more_languages}} part in {{More_Languages}}.

Here {{more_languages}} is <a dangerouslySetInnerHTML={{ __html: 'beta.apertium.org' }} href='https://beta.apertium.org' rel='noreferrer' target='_blank'/>

and since this appeared quite modular I thought of going ahead with this implementation.

@sushain97 any follow-up on this or any workaround, you would like to suggest?

sushain97 commented 2 years ago

Maybe you could add a configuration option that enabled or disabled showing this string?

@jonorthwash requested this feature so perhaps he has an opinion on whether it matters that we show this string on both apertium.org and beta.apertium.org?

sushain97 commented 2 years ago

To end all confusions I have added a logic to check the path of the route and conditionally render the string.

Rather than casing on the location within the frontend, we should have a configuration option that conditionally renders the URL.

Also, please write a test for any new functionality that exercises both paths (renders and doesn't render).