Hello @shibani06
If the url pattern is same then you can do something similar to this:
- create a servlet that will take the current page path as param and generate other alternate regional paths
- create a custom component that will only be visible on author in view as published (wcmmode=disabled)
- the component will render the following markup with the JS from a clientlibs
<input id="Button1" type="button" value="button" onclick="fetchAndOpenURLs()" />
<script type="text/javascript">
function fetchAndOpenURLs() {
// Send an AJAX request to the servlet to get the generated URLs.
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
if (xhr.readyState === 4 && xhr.status === 200) {
var urls = JSON.parse(xhr.responseText);
// Open each URL in a new tab.
urls.forEach(function(url) {
window.open(url, '_blank');
});
}
};
xhr.open('GET', '/your-web-app-context-path/generateURLs', true);
xhr.send();
}
</script>
To perform well you can keep a map of locales in the cache after first invocation:
[
{
"us": ["en_us"],
"be": ["nl_be", "fr_be"],
..
}
]
Let me know if that make senses..
Thanks