Last active
August 31, 2016 21:21
-
-
Save jamesplease/895da463b22a3cd219c9ff5b4d4d148b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// need to fill these out | |
const RTL = ['ar', 'whatevs']; | |
const reverseComma = ['ar']; | |
function generateList(arr, languageCode) { | |
const rtl = RTL.indexOf(languageCode) >= 0; | |
const comma = reverseComma.indexOf(languageCode) >= 0 ? '،' : ','; | |
if (rtl) { | |
return arr.reverse().join(` ${comma}`); | |
} else { | |
return arr.join(`${comma} `) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment