diff --git a/CHANGES.md b/CHANGES.md index 1791f071487b..5762a03049b7 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -9,6 +9,7 @@ Change Log * Added CZML support for `polyline.depthFailMaterial`, `label.scaleByDistance`, `distanceDisplayCondition`, and `disableDepthTestDistance`. [#5986](https://github.com/AnalyticalGraphicsInc/cesium/pull/5986) * Fixed bug in KML LookAt bug where degrees and radians were mixing in a subtraction. [#5992](https://github.com/AnalyticalGraphicsInc/cesium/issues/5992) * Fixed handling of KMZ files with missing `xsi` namespace declarations. [#6003](https://github.com/AnalyticalGraphicsInc/cesium/pull/6003) +* Fixed a language detection issue. [#6016](https://github.com/AnalyticalGraphicsInc/cesium/pull/6016) * Fixed a bug where glTF models with animations of different lengths would cause an error. [#5694](https://github.com/AnalyticalGraphicsInc/cesium/issues/5694) * Added a `clampAnimations` parameter to `Model` and `Entity.model`. Setting this to `false` allows different length animations to loop asynchronously over the duration of the longest animation. * Fixed `Invalid asm.js: Invalid member of stdlib` console error by recompiling crunch.js with latest emscripten toolchain. [#5847](https://github.com/AnalyticalGraphicsInc/cesium/issues/5847) diff --git a/Source/Scene/Label.js b/Source/Scene/Label.js index 863dc80d3785..19fd2f7976a5 100644 --- a/Source/Scene/Label.js +++ b/Source/Scene/Label.js @@ -1311,9 +1311,9 @@ define([ } } - //To add another language, simply add it's Unicode block range(s) to the below regex. + //To add another language, simply add its Unicode block range(s) to the below regex. var hebrew = '\u05D0-\u05EA'; - var arabic = '\u0600-\u06FF\u0750–\u077F\u08A0–\u08FF'; + var arabic = '\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF'; var rtlChars = new RegExp('[' + hebrew + arabic + ']'); /** diff --git a/Specs/Scene/LabelCollectionSpec.js b/Specs/Scene/LabelCollectionSpec.js index f54eda7c1b40..251f2d23fbac 100644 --- a/Specs/Scene/LabelCollectionSpec.js +++ b/Specs/Scene/LabelCollectionSpec.js @@ -1934,6 +1934,50 @@ defineSuite([ expect(label.text).toEqual(expectedText); }); + + it('detects characters in the range \\u05D0-\\u05EA', function() { + var text = '\u05D1\u05D2'; + var expectedText = '\u05D2\u05D1'; + var label = labels.add({ + text : text + }); + + expect(label.text).toEqual(text); + expect(label._renderedText).toEqual(expectedText); + }); + + it('detects characters in the range \\u0600-\\u06FF', function() { + var text = '\u0601\u0602'; + var expectedText = '\u0602\u0601'; + var label = labels.add({ + text : text + }); + + expect(label.text).toEqual(text); + expect(label._renderedText).toEqual(expectedText); + }); + + it('detects characters in the range \\u0750-\\u077F', function() { + var text = '\u0751\u0752'; + var expectedText = '\u0752\u0751'; + var label = labels.add({ + text : text + }); + + expect(label.text).toEqual(text); + expect(label._renderedText).toEqual(expectedText); + }); + + it('detects characters in the range \\u08A0-\\u08FF', function() { + var text = '\u08A1\u08A2'; + var expectedText = '\u08A2\u08A1'; + var label = labels.add({ + text : text + }); + + expect(label.text).toEqual(text); + expect(label._renderedText).toEqual(expectedText); + }); }); it('computes bounding sphere in 3D', function() {