diff --git a/js/util/StringUtils.js b/js/util/StringUtils.js index 8e79a8b9..4cf9babf 100644 --- a/js/util/StringUtils.js +++ b/js/util/StringUtils.js @@ -290,6 +290,28 @@ const StringUtils = { return string.replace( /\u202a/g, '[LTR]' ).replace( /\u202b/g, '[RTL]' ).replace( /\u202c/g, '[POP]' ); }, + /** + * Wraps a string with embedding marks for LTR display. + * @public + * + * @param {string} string + * @returns {string} + */ + wrapLTR: function( string ) { + return LTR + string + POP; + }, + + /** + * Wraps a string with embedding marks for RTL display. + * @public + * + * @param {string} string + * @returns {string} + */ + wrapRTL: function( string ) { + return LTR + string + POP; + }, + /** * Assert that a template var is in a string. Useful for translated strings with a template var pattern like * "Hello {{meanName}}" --> "Hello goofball". See StringUtils.fillIn() for base usages of template var pattern.