Fix localized slug creation when using history and when the locale changes after document is created