Lately, I've been going wild about locales and outputting the correct date/time formats, number formats, money sum formats, percentage signs, etc. for each locale/language combination. Instead of figuring out and hardcoding this myself, which would have taken me hundreds of years, I use PHP's built-in classes such as NumberFormatter: https://www.php.net/NumberFormatter and some of the rest of the classes in the right list on that page.
However, then I got thinking about quotation marks and how I have always known that they differ greatly between languages and regions. I therefore searched all around the classes and online, but oddly found nothing related to outputting quotes.
So, have they simply left this out? Or have I just not found it? If you skim this Wikipedia article, you will see how many different quotation marks/styles there are: https://en.wikipedia.org/wiki/Quotation_mark
Just like my applications now outputs "everything" else properly depending on the locale, I now wish to also be able to output quotes in the correct manner. It's no longer good enough for me to just use the standard English style:
"This is a quote: 'And this is a nested quote.'"
I will be using the above style internally, for the actual "content strings" stored in the database, but when I actually output it for a given locale, I want it to become (for example, for Germany/German):
‚This is a quote: „And this is a nested quote.“‘
Essentially, I want something like (this is made up, based on the syntax used for NumberFormatter):
$a = new QuoteFormatter( 'de_DE', QuoteFormatter::MOSTCOMMON );
echo $a>format('"This is a quote: \'And this is a nested quote.\'"');
And it would output (since Germany/German was specified):
‚This is a quote: „And this is a nested quote.“‘
Please tell me that such a thing exists somewhere in the mysterious, ancient scrolls of the PHP manual and I just haven't been able to find it! Many times before, I have found features in PHP which have existed for 15-20 years and which I never had an idea were in there, and would've saved me an insane amount of headaches...