<p>Sean Bright has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/10527">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">say: Remove legacy language deprecation logic<br><br>These language codes (tw, ge, mx, and cz) were deprecated in 1.6.2.<br><br>Change-Id: I18e4d2af2e83556fa91e39a7338030583ef05d50<br>---<br>M main/say.c<br>1 file changed, 18 insertions(+), 90 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/27/10527/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/main/say.c b/main/say.c</span><br><span>index a44ba85..f456459 100644</span><br><span>--- a/main/say.c</span><br><span>+++ b/main/say.c</span><br><span>@@ -481,73 +481,49 @@</span><br><span> {</span><br><span> ast_test_suite_event_notify("SAYNUM", "Message: saying number %d\r\nNumber: %d\r\nChannel: %s", num, num, ast_channel_name(chan));</span><br><span> if (!strncasecmp(language, "en_GB", 5)) { /* British syntax */</span><br><span style="color: hsl(0, 100%, 40%);">- return ast_say_number_full_en_GB(chan, num, ints, language, audiofd, ctrlfd);</span><br><span style="color: hsl(120, 100%, 40%);">+ return ast_say_number_full_en_GB(chan, num, ints, language, audiofd, ctrlfd);</span><br><span> } else if (!strncasecmp(language, "en", 2)) { /* English syntax */</span><br><span style="color: hsl(0, 100%, 40%);">- return ast_say_number_full_en(chan, num, ints, language, audiofd, ctrlfd);</span><br><span style="color: hsl(120, 100%, 40%);">+ return ast_say_number_full_en(chan, num, ints, language, audiofd, ctrlfd);</span><br><span> } else if (!strncasecmp(language, "cs", 2)) { /* Czech syntax */</span><br><span style="color: hsl(0, 100%, 40%);">- return ast_say_number_full_cs(chan, num, ints, language, options, audiofd, ctrlfd);</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (!strncasecmp(language, "cz", 2)) { /* deprecated Czech syntax */</span><br><span style="color: hsl(0, 100%, 40%);">- static int deprecation_warning = 0;</span><br><span style="color: hsl(0, 100%, 40%);">- if (deprecation_warning++ % 10 == 0) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_log(LOG_WARNING, "cz is not a standard language code. Please switch to using cs instead.\n");</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span> return ast_say_number_full_cs(chan, num, ints, language, options, audiofd, ctrlfd);</span><br><span> } else if (!strncasecmp(language, "da", 2)) { /* Danish syntax */</span><br><span style="color: hsl(0, 100%, 40%);">- return ast_say_number_full_da(chan, num, ints, language, options, audiofd, ctrlfd);</span><br><span style="color: hsl(120, 100%, 40%);">+ return ast_say_number_full_da(chan, num, ints, language, options, audiofd, ctrlfd);</span><br><span> } else if (!strncasecmp(language, "de", 2)) { /* German syntax */</span><br><span style="color: hsl(0, 100%, 40%);">- return ast_say_number_full_de(chan, num, ints, language, options, audiofd, ctrlfd);</span><br><span style="color: hsl(120, 100%, 40%);">+ return ast_say_number_full_de(chan, num, ints, language, options, audiofd, ctrlfd);</span><br><span> } else if (!strncasecmp(language, "es", 2)) { /* Spanish syntax */</span><br><span style="color: hsl(0, 100%, 40%);">- return ast_say_number_full_es(chan, num, ints, language, options, audiofd, ctrlfd);</span><br><span style="color: hsl(120, 100%, 40%);">+ return ast_say_number_full_es(chan, num, ints, language, options, audiofd, ctrlfd);</span><br><span> } else if (!strncasecmp(language, "fr", 2)) { /* French syntax */</span><br><span style="color: hsl(0, 100%, 40%);">- return ast_say_number_full_fr(chan, num, ints, language, options, audiofd, ctrlfd);</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (!strncasecmp(language, "ge", 2)) { /* deprecated Georgian syntax */</span><br><span style="color: hsl(0, 100%, 40%);">- static int deprecation_warning = 0;</span><br><span style="color: hsl(0, 100%, 40%);">- if (deprecation_warning++ % 10 == 0) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_log(LOG_WARNING, "ge is not a standard language code. Please switch to using ka instead.\n");</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- return ast_say_number_full_ka(chan, num, ints, language, options, audiofd, ctrlfd);</span><br><span style="color: hsl(120, 100%, 40%);">+ return ast_say_number_full_fr(chan, num, ints, language, options, audiofd, ctrlfd);</span><br><span> } else if (!strncasecmp(language, "gr", 2)) { /* Greek syntax */</span><br><span style="color: hsl(0, 100%, 40%);">- return ast_say_number_full_gr(chan, num, ints, language, audiofd, ctrlfd);</span><br><span style="color: hsl(120, 100%, 40%);">+ return ast_say_number_full_gr(chan, num, ints, language, audiofd, ctrlfd);</span><br><span> } else if (!strncasecmp(language, "ja", 2)) { /* Japanese syntax */</span><br><span style="color: hsl(0, 100%, 40%);">- return ast_say_number_full_ja(chan, num, ints, language, audiofd, ctrlfd);</span><br><span style="color: hsl(120, 100%, 40%);">+ return ast_say_number_full_ja(chan, num, ints, language, audiofd, ctrlfd);</span><br><span> } else if (!strncasecmp(language, "he", 2)) { /* Hebrew syntax */</span><br><span style="color: hsl(0, 100%, 40%);">- return ast_say_number_full_he(chan, num, ints, language, options, audiofd, ctrlfd);</span><br><span style="color: hsl(120, 100%, 40%);">+ return ast_say_number_full_he(chan, num, ints, language, options, audiofd, ctrlfd);</span><br><span> } else if (!strncasecmp(language, "hu", 2)) { /* Hungarian syntax */</span><br><span> return ast_say_number_full_hu(chan, num, ints, language, audiofd, ctrlfd);</span><br><span> } else if (!strncasecmp(language, "is", 2)) { /* Icelandic syntax */</span><br><span> return ast_say_number_full_is(chan, num, ints, language, options, audiofd, ctrlfd);</span><br><span> } else if (!strncasecmp(language, "it", 2)) { /* Italian syntax */</span><br><span style="color: hsl(0, 100%, 40%);">- return ast_say_number_full_it(chan, num, ints, language, audiofd, ctrlfd);</span><br><span style="color: hsl(120, 100%, 40%);">+ return ast_say_number_full_it(chan, num, ints, language, audiofd, ctrlfd);</span><br><span> } else if (!strncasecmp(language, "ka", 2)) { /* Georgian syntax */</span><br><span style="color: hsl(0, 100%, 40%);">- return ast_say_number_full_ka(chan, num, ints, language, options, audiofd, ctrlfd);</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (!strncasecmp(language, "mx", 2)) { /* deprecated Mexican syntax */</span><br><span style="color: hsl(0, 100%, 40%);">- static int deprecation_warning = 0;</span><br><span style="color: hsl(0, 100%, 40%);">- if (deprecation_warning++ % 10 == 0) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_log(LOG_WARNING, "mx is not a standard language code. Please switch to using es_MX instead.\n");</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- return ast_say_number_full_es(chan, num, ints, language, options, audiofd, ctrlfd);</span><br><span style="color: hsl(120, 100%, 40%);">+ return ast_say_number_full_ka(chan, num, ints, language, options, audiofd, ctrlfd);</span><br><span> } else if (!strncasecmp(language, "nl", 2)) { /* Dutch syntax */</span><br><span style="color: hsl(0, 100%, 40%);">- return ast_say_number_full_nl(chan, num, ints, language, audiofd, ctrlfd);</span><br><span style="color: hsl(120, 100%, 40%);">+ return ast_say_number_full_nl(chan, num, ints, language, audiofd, ctrlfd);</span><br><span> } else if (!strncasecmp(language, "no", 2)) { /* Norwegian syntax */</span><br><span style="color: hsl(0, 100%, 40%);">- return ast_say_number_full_no(chan, num, ints, language, options, audiofd, ctrlfd);</span><br><span style="color: hsl(120, 100%, 40%);">+ return ast_say_number_full_no(chan, num, ints, language, options, audiofd, ctrlfd);</span><br><span> } else if (!strncasecmp(language, "pl", 2)) { /* Polish syntax */</span><br><span style="color: hsl(0, 100%, 40%);">- return ast_say_number_full_pl(chan, num, ints, language, options, audiofd, ctrlfd);</span><br><span style="color: hsl(120, 100%, 40%);">+ return ast_say_number_full_pl(chan, num, ints, language, options, audiofd, ctrlfd);</span><br><span> } else if (!strncasecmp(language, "pt", 2)) { /* Portuguese syntax */</span><br><span style="color: hsl(0, 100%, 40%);">- return ast_say_number_full_pt(chan, num, ints, language, options, audiofd, ctrlfd);</span><br><span style="color: hsl(120, 100%, 40%);">+ return ast_say_number_full_pt(chan, num, ints, language, options, audiofd, ctrlfd);</span><br><span> } else if (!strncasecmp(language, "ru", 2)) { /* Russian syntax */</span><br><span style="color: hsl(0, 100%, 40%);">- return ast_say_number_full_ru(chan, num, ints, language, options, audiofd, ctrlfd);</span><br><span style="color: hsl(120, 100%, 40%);">+ return ast_say_number_full_ru(chan, num, ints, language, options, audiofd, ctrlfd);</span><br><span> } else if (!strncasecmp(language, "se", 2)) { /* Swedish syntax */</span><br><span style="color: hsl(0, 100%, 40%);">- return ast_say_number_full_se(chan, num, ints, language, options, audiofd, ctrlfd);</span><br><span style="color: hsl(120, 100%, 40%);">+ return ast_say_number_full_se(chan, num, ints, language, options, audiofd, ctrlfd);</span><br><span> } else if (!strncasecmp(language, "th", 2)) { /* Thai syntax */</span><br><span> return ast_say_number_full_th(chan, num, ints, language, audiofd, ctrlfd);</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (!strncasecmp(language, "tw", 2)) { /* deprecated Taiwanese syntax */</span><br><span style="color: hsl(0, 100%, 40%);">- static int deprecation_warning = 0;</span><br><span style="color: hsl(0, 100%, 40%);">- if (deprecation_warning++ % 10 == 0) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_log(LOG_WARNING, "tw is a standard language code for Twi, not Taiwanese. Please switch to using zh_TW instead.\n");</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- return ast_say_number_full_zh(chan, num, ints, language, audiofd, ctrlfd);</span><br><span> } else if (!strncasecmp(language, "zh", 2)) { /* Taiwanese / Chinese syntax */</span><br><span style="color: hsl(0, 100%, 40%);">- return ast_say_number_full_zh(chan, num, ints, language, audiofd, ctrlfd);</span><br><span style="color: hsl(120, 100%, 40%);">+ return ast_say_number_full_zh(chan, num, ints, language, audiofd, ctrlfd);</span><br><span> } else if (!strncasecmp(language, "ur", 2)) { /* Urdu syntax */</span><br><span> return ast_say_number_full_ur(chan, num, ints, language, options, audiofd, ctrlfd);</span><br><span> } else if (!strncasecmp(language, "vi", 2)) { /* Vietnamese syntax */</span><br><span>@@ -3645,12 +3621,6 @@</span><br><span> return ast_say_date_de(chan, t, ints, lang);</span><br><span> } else if (!strncasecmp(lang, "fr", 2)) { /* French syntax */</span><br><span> return ast_say_date_fr(chan, t, ints, lang);</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (!strncasecmp(lang, "ge", 2)) { /* deprecated Georgian syntax */</span><br><span style="color: hsl(0, 100%, 40%);">- static int deprecation_warning = 0;</span><br><span style="color: hsl(0, 100%, 40%);">- if (deprecation_warning++ % 10 == 0) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_log(LOG_WARNING, "ge is not a standard language code. Please switch to using ka instead.\n");</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- return ast_say_date_ka(chan, t, ints, lang);</span><br><span> } else if (!strncasecmp(lang, "gr", 2)) { /* Greek syntax */</span><br><span> return ast_say_date_gr(chan, t, ints, lang);</span><br><span> } else if (!strncasecmp(lang, "ja", 2)) { /* Japanese syntax */</span><br><span>@@ -4061,12 +4031,6 @@</span><br><span> return ast_say_date_with_format_ja(chan, t, ints, lang, format, tzone);</span><br><span> } else if (!strncasecmp(lang, "it", 2)) { /* Italian syntax */</span><br><span> return ast_say_date_with_format_it(chan, t, ints, lang, format, tzone);</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (!strncasecmp(lang, "mx", 2)) { /* deprecated Mexican syntax */</span><br><span style="color: hsl(0, 100%, 40%);">- static int deprecation_warning = 0;</span><br><span style="color: hsl(0, 100%, 40%);">- if (deprecation_warning++ % 10 == 0) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_log(LOG_WARNING, "mx is not a standard language code. Please switch to using es_MX instead.\n");</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- return ast_say_date_with_format_es(chan, t, ints, lang, format, tzone);</span><br><span> } else if (!strncasecmp(lang, "nl", 2)) { /* Dutch syntax */</span><br><span> return ast_say_date_with_format_nl(chan, t, ints, lang, format, tzone);</span><br><span> } else if (!strncasecmp(lang, "pl", 2)) { /* Polish syntax */</span><br><span>@@ -4075,12 +4039,6 @@</span><br><span> return ast_say_date_with_format_pt(chan, t, ints, lang, format, tzone);</span><br><span> } else if (!strncasecmp(lang, "th", 2)) { /* Thai syntax */</span><br><span> return ast_say_date_with_format_th(chan, t, ints, lang, format, tzone);</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (!strncasecmp(lang, "tw", 2)) { /* deprecated Taiwanese syntax */</span><br><span style="color: hsl(0, 100%, 40%);">- static int deprecation_warning = 0;</span><br><span style="color: hsl(0, 100%, 40%);">- if (deprecation_warning++ % 10 == 0) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_log(LOG_WARNING, "tw is a standard language code for Twi, not Taiwanese. Please switch to using zh_TW instead.\n");</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- return ast_say_date_with_format_zh(chan, t, ints, lang, format, tzone);</span><br><span> } else if (!strncasecmp(lang, "zh", 2)) { /* Taiwanese / Chinese syntax */</span><br><span> return ast_say_date_with_format_zh(chan, t, ints, lang, format, tzone);</span><br><span> } else if (!strncasecmp(lang, "vi", 2)) { /* Vietnamese syntax */</span><br><span>@@ -6897,12 +6855,6 @@</span><br><span> return ast_say_time_de(chan, t, ints, lang);</span><br><span> } else if (!strncasecmp(lang, "fr", 2)) { /* French syntax */</span><br><span> return ast_say_time_fr(chan, t, ints, lang);</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (!strncasecmp(lang, "ge", 2)) { /* deprecated Georgian syntax */</span><br><span style="color: hsl(0, 100%, 40%);">- static int deprecation_warning = 0;</span><br><span style="color: hsl(0, 100%, 40%);">- if (deprecation_warning++ % 10 == 0) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_log(LOG_WARNING, "ge is not a standard language code. Please switch to using ka instead.\n");</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- return ast_say_time_ka(chan, t, ints, lang);</span><br><span> } else if (!strncasecmp(lang, "gr", 2)) { /* Greek syntax */</span><br><span> return ast_say_time_gr(chan, t, ints, lang);</span><br><span> } else if (!strncasecmp(lang, "ja", 2)) { /* Japanese syntax */</span><br><span>@@ -6921,12 +6873,6 @@</span><br><span> return ast_say_time_pt(chan, t, ints, lang);</span><br><span> } else if (!strncasecmp(lang, "th", 2)) { /* Thai syntax */</span><br><span> return(ast_say_time_th(chan, t, ints, lang));</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (!strncasecmp(lang, "tw", 2)) { /* deprecated Taiwanese syntax */</span><br><span style="color: hsl(0, 100%, 40%);">- static int deprecation_warning = 0;</span><br><span style="color: hsl(0, 100%, 40%);">- if (deprecation_warning++ % 10 == 0) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_log(LOG_WARNING, "tw is a standard language code for Twi, not Taiwanese. Please switch to using zh_TW instead.\n");</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- return ast_say_time_zh(chan, t, ints, lang);</span><br><span> } else if (!strncasecmp(lang, "zh", 2)) { /* Taiwanese / Chinese syntax */</span><br><span> return ast_say_time_zh(chan, t, ints, lang);</span><br><span> }</span><br><span>@@ -7230,12 +7176,6 @@</span><br><span> return ast_say_datetime_de(chan, t, ints, lang);</span><br><span> } else if (!strncasecmp(lang, "fr", 2)) { /* French syntax */</span><br><span> return ast_say_datetime_fr(chan, t, ints, lang);</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (!strncasecmp(lang, "ge", 2)) { /* deprecated Georgian syntax */</span><br><span style="color: hsl(0, 100%, 40%);">- static int deprecation_warning = 0;</span><br><span style="color: hsl(0, 100%, 40%);">- if (deprecation_warning++ % 10 == 0) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_log(LOG_WARNING, "ge is not a standard language code. Please switch to using ka instead.\n");</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- return ast_say_datetime_ka(chan, t, ints, lang);</span><br><span> } else if (!strncasecmp(lang, "gr", 2)) { /* Greek syntax */</span><br><span> return ast_say_datetime_gr(chan, t, ints, lang);</span><br><span> } else if (!strncasecmp(lang, "ja", 2)) { /* Japanese syntax */</span><br><span>@@ -7254,12 +7194,6 @@</span><br><span> return ast_say_datetime_pt(chan, t, ints, lang);</span><br><span> } else if (!strncasecmp(lang, "th", 2)) { /* Thai syntax */</span><br><span> return ast_say_datetime_th(chan, t, ints, lang);</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (!strncasecmp(lang, "tw", 2)) { /* deprecated Taiwanese syntax */</span><br><span style="color: hsl(0, 100%, 40%);">- static int deprecation_warning = 0;</span><br><span style="color: hsl(0, 100%, 40%);">- if (deprecation_warning++ % 10 == 0) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_log(LOG_WARNING, "tw is a standard language code for Twi, not Taiwanese. Please switch to using zh_TW instead.\n");</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- return ast_say_datetime_zh(chan, t, ints, lang);</span><br><span> } else if (!strncasecmp(lang, "zh", 2)) { /* Taiwanese / Chinese syntax */</span><br><span> return ast_say_datetime_zh(chan, t, ints, lang);</span><br><span> }</span><br><span>@@ -7680,12 +7614,6 @@</span><br><span> return ast_say_datetime_from_now_en(chan, t, ints, lang);</span><br><span> } else if (!strncasecmp(lang, "fr", 2)) { /* French syntax */</span><br><span> return ast_say_datetime_from_now_fr(chan, t, ints, lang);</span><br><span style="color: hsl(0, 100%, 40%);">- } else if (!strncasecmp(lang, "ge", 2)) { /* deprecated Georgian syntax */</span><br><span style="color: hsl(0, 100%, 40%);">- static int deprecation_warning = 0;</span><br><span style="color: hsl(0, 100%, 40%);">- if (deprecation_warning++ % 10 == 0) {</span><br><span style="color: hsl(0, 100%, 40%);">- ast_log(LOG_WARNING, "ge is not a standard language code. Please switch to using ka instead.\n");</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- return ast_say_datetime_from_now_ka(chan, t, ints, lang);</span><br><span> } else if (!strncasecmp(lang, "he", 2)) { /* Hebrew syntax */</span><br><span> return ast_say_datetime_from_now_he(chan, t, ints, lang);</span><br><span> } else if (!strncasecmp(lang, "ka", 2)) { /* Georgian syntax */</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/10527">change 10527</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/10527"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I18e4d2af2e83556fa91e39a7338030583ef05d50 </div>
<div style="display:none"> Gerrit-Change-Number: 10527 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Sean Bright <sean.bright@gmail.com> </div>