mirror of
https://github.com/element-hq/element-web
synced 2024-11-26 11:15:53 +03:00
munge the emoji names from rust-sdk to match translations (#11168)
This commit is contained in:
parent
d87be36800
commit
7c211b0587
1 changed files with 12 additions and 1 deletions
|
@ -42,8 +42,19 @@ interface IState {
|
||||||
cancelling?: boolean;
|
cancelling?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Convert the names of emojis returned by the js-sdk into the display names, which we use as
|
||||||
|
* a base for our translations.
|
||||||
|
*/
|
||||||
function capFirst(s: string): string {
|
function capFirst(s: string): string {
|
||||||
return s.charAt(0).toUpperCase() + s.slice(1);
|
// Our translations (currently) have names like "Thumbs up".
|
||||||
|
//
|
||||||
|
// With legacy crypto, the js-sdk returns lower-case names ("thumbs up"). With Rust crypto, the js-sdk follows
|
||||||
|
// the spec and returns title-case names ("Thumbs Up"). So, to convert both into names that match our i18n data,
|
||||||
|
// we upcase the first character and downcase the rest.
|
||||||
|
//
|
||||||
|
// Once legacy crypto is dead, we could consider getting rid of this and just making the i18n data use the
|
||||||
|
// title-case names (which would also match the spec).
|
||||||
|
return s.charAt(0).toUpperCase() + s.slice(1).toLowerCase();
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class VerificationShowSas extends React.Component<IProps, IState> {
|
export default class VerificationShowSas extends React.Component<IProps, IState> {
|
||||||
|
|
Loading…
Reference in a new issue