How to determine if a site page is a translation after a redirect?

%3CLINGO-SUB%20id%3D%22lingo-sub-2187998%22%20slang%3D%22en-US%22%3EHow%20to%20determine%20if%20a%20site%20page%20is%20a%20translation%20after%20a%20redirect%3F%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2187998%22%20slang%3D%22en-US%22%3E%3CP%3EWhen%20a%20user%20hits%20a%20site%20page%20URL%2C%20but%20is%20immediately%20redirected%20to%20a%20translated%20page%2C%20the%20translated%20page's%20context%20is%20still%20of%20the%20original%20site%20page%2C%20not%20the%20translated%20page.%20If%20you%20try%20to%20use%20this%20context%20and%20list%20item%20ID%20to%20check%20if%20the%20page%20is%20a%20translation%2C%20you'll%20get%20a%20false%20because%20you're%20using%20the%20original%20page%20list%20item%20ID.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHow%20would%20you%20determine%20if%20the%20page%20is%20a%20translation%20or%20not%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EInstructions%20on%20how%20to%20recreate%20the%20issue%20are%20here%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FSharePoint%2Fsp-dev-docs%2Fissues%2F6782%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2FSharePoint%2Fsp-dev-docs%2Fissues%2F6782%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAttached%20is%20a%20GIF%20that%20shows%20how%20a%20translated%20page%20shows%20the%20correct%20list%20item%20ID%20on%20a%20hard%20refresh%2C%20but%20the%20wrong%20list%20item%20ID%20is%20shown%20after%20redirection.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Senior Member

When a user hits a site page URL, but is immediately redirected to a translated page, the translated page's context is still of the original site page, not the translated page. If you try to use this context and list item ID to check if the page is a translation, you'll get a false because you're using the original page list item ID.

 

How would you determine if the page is a translation or not?

 

Instructions on how to recreate the issue are here: https://github.com/SharePoint/sp-dev-docs/issues/6782

 

Attached is a GIF that shows how a translated page shows the correct list item ID on a hard refresh, but the wrong list item ID is shown after redirection.

0 Replies