Skip to content

Commit e06fca7

Browse files
authored
Merge pull request #164 from Project-OSRM/1ec5-locale-upper
Respect locale when capitalizing
2 parents 99c5f38 + 34a1224 commit e06fca7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ module.exports = function(version, _options) {
1111
});
1212

1313
return {
14-
capitalizeFirstLetter: function(string) {
15-
return string.charAt(0).toUpperCase() + string.slice(1);
14+
capitalizeFirstLetter: function(language, string) {
15+
return string.charAt(0).toLocaleUpperCase(language) + string.slice(1);
1616
},
1717
ordinalize: function(language, number) {
1818
// Transform numbers to their translated ordinalized value
@@ -206,7 +206,7 @@ module.exports = function(version, _options) {
206206
.replace(/ {2}/g, ' '); // remove excess spaces
207207

208208
if (instructions[language].meta.capitalizeFirstLetter) {
209-
return this.capitalizeFirstLetter(output);
209+
return this.capitalizeFirstLetter(language, output);
210210
}
211211

212212
return output;

0 commit comments

Comments
 (0)