Translations get cut off after 1 character.
See original GitHub issueUsing the following I get a strange quirk…
interface HomePageState {
translate: any;
}
type HomePageProps = HomePageState
class Home extends React.Component<HomePageProps, HomePageState> {
/// the below will only render "I"
public render(): any {
return <label>{ this.props.translate("home.slogan") }</label>;
}
}
const addTranslateToProps = state => {
console.log('state.locale', state.locale);
// this will log out "translations: { home.slogan: "I'm the correct translation" }
return {
translate: getTranslate(state.locale)
}
};
export default connect(
addTranslateToProps
)(Home) as typeof Home;
To be clear:
The translations state seems to contain the correct translation / localization, but the translate
function exposed via props, does not work as expected.
I do believe it might be a dependent lib (reselect??) thats causing the problem, but not too sure… if anyone has encountered this before, any advice would be appreciated. I’m happy to supply any other information thats needed.
Other info: Stack is on top of dotnetcore, React + Redux + SSR (with webpack for bundling front end stuff)
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How to remove punctuation marks from a string in Python 3.x ...
punctuation , just concatenate string.punctuation with a string of characters you also want removed, like translator = str.maketrans({key: None ...
Read more >How to break lines - TED Translators Wiki
Below, you will find strategies you can use when deciding where to break the subtile into two lines. Keep the line length balanced....
Read more >SQL Server TRANSLATE() Function - W3Schools
The TRANSLATE() function returns the string from the first argument after the characters specified in the second argument are translated into the characters ......
Read more >Translation Considerations for Flows - Salesforce Help
When you use Translation Workbench to translate flows, note these considerations. ... Other translations for flow labels have a maximum of 1,000 characters....
Read more >KB42953: After translation is imported through MicroStrategy ...
KB42953: After translation is imported through MicroStrategy Repository Translation Wizard, translation strings are missing or cut off in ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@rohan-buchner would you be able to provide the following:
Also have you tried adding additional translations? Does this occur for others as well? If not I would try removing the apostrophe from “I’m” and see if that makes a difference. By any chance are you copy and pasting the content from another program like Word? If it is the apostrophe causing issues I suspect it could be an encoding issue.
Thanks
Glad it worked out. I think I’m going to try and tighten up the typings for the translation data, as that might help catch this issue for anyone using TypeScript or Flow.