[Asterisk-code-review] say: Remove legacy language deprecation logic (asterisk[master])

Sean Bright asteriskteam at digium.com
Tue Oct 23 07:47:07 CDT 2018


Sean Bright has uploaded this change for review. ( https://gerrit.asterisk.org/10527


Change subject: say: Remove legacy language deprecation logic
......................................................................

say: Remove legacy language deprecation logic

These language codes (tw, ge, mx, and cz) were deprecated in 1.6.2.

Change-Id: I18e4d2af2e83556fa91e39a7338030583ef05d50
---
M main/say.c
1 file changed, 18 insertions(+), 90 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/27/10527/1

diff --git a/main/say.c b/main/say.c
index a44ba85..f456459 100644
--- a/main/say.c
+++ b/main/say.c
@@ -481,73 +481,49 @@
 {
 	ast_test_suite_event_notify("SAYNUM", "Message: saying number %d\r\nNumber: %d\r\nChannel: %s", num, num, ast_channel_name(chan));
 	if (!strncasecmp(language, "en_GB", 5)) {     /* British syntax */
-	   return ast_say_number_full_en_GB(chan, num, ints, language, audiofd, ctrlfd);
+		return ast_say_number_full_en_GB(chan, num, ints, language, audiofd, ctrlfd);
 	} else if (!strncasecmp(language, "en", 2)) { /* English syntax */
-	   return ast_say_number_full_en(chan, num, ints, language, audiofd, ctrlfd);
+		return ast_say_number_full_en(chan, num, ints, language, audiofd, ctrlfd);
 	} else if (!strncasecmp(language, "cs", 2)) { /* Czech syntax */
-	   return ast_say_number_full_cs(chan, num, ints, language, options, audiofd, ctrlfd);
-	} else if (!strncasecmp(language, "cz", 2)) { /* deprecated Czech syntax */
-		static int deprecation_warning = 0;
-		if (deprecation_warning++ % 10 == 0) {
-			ast_log(LOG_WARNING, "cz is not a standard language code.  Please switch to using cs instead.\n");
-		}
 		return ast_say_number_full_cs(chan, num, ints, language, options, audiofd, ctrlfd);
 	} else if (!strncasecmp(language, "da", 2)) { /* Danish syntax */
-	   return ast_say_number_full_da(chan, num, ints, language, options, audiofd, ctrlfd);
+		return ast_say_number_full_da(chan, num, ints, language, options, audiofd, ctrlfd);
 	} else if (!strncasecmp(language, "de", 2)) { /* German syntax */
-	   return ast_say_number_full_de(chan, num, ints, language, options, audiofd, ctrlfd);
+		return ast_say_number_full_de(chan, num, ints, language, options, audiofd, ctrlfd);
 	} else if (!strncasecmp(language, "es", 2)) { /* Spanish syntax */
-	   return ast_say_number_full_es(chan, num, ints, language, options, audiofd, ctrlfd);
+		return ast_say_number_full_es(chan, num, ints, language, options, audiofd, ctrlfd);
 	} else if (!strncasecmp(language, "fr", 2)) { /* French syntax */
-	   return ast_say_number_full_fr(chan, num, ints, language, options, audiofd, ctrlfd);
-	} else if (!strncasecmp(language, "ge", 2)) { /* deprecated Georgian syntax */
-		static int deprecation_warning = 0;
-		if (deprecation_warning++ % 10 == 0) {
-			ast_log(LOG_WARNING, "ge is not a standard language code.  Please switch to using ka instead.\n");
-		}
-		return ast_say_number_full_ka(chan, num, ints, language, options, audiofd, ctrlfd);
+		return ast_say_number_full_fr(chan, num, ints, language, options, audiofd, ctrlfd);
 	} else if (!strncasecmp(language, "gr", 2)) { /* Greek syntax */
-	   return ast_say_number_full_gr(chan, num, ints, language, audiofd, ctrlfd);
+		return ast_say_number_full_gr(chan, num, ints, language, audiofd, ctrlfd);
 	} else if (!strncasecmp(language, "ja", 2)) { /* Japanese syntax */
-	   return ast_say_number_full_ja(chan, num, ints, language, audiofd, ctrlfd);
+		return ast_say_number_full_ja(chan, num, ints, language, audiofd, ctrlfd);
 	} else if (!strncasecmp(language, "he", 2)) { /* Hebrew syntax */
-	   return ast_say_number_full_he(chan, num, ints, language, options, audiofd, ctrlfd);
+		return ast_say_number_full_he(chan, num, ints, language, options, audiofd, ctrlfd);
 	} else if (!strncasecmp(language, "hu", 2)) { /* Hungarian syntax */
 		return ast_say_number_full_hu(chan, num, ints, language, audiofd, ctrlfd);
 	} else if (!strncasecmp(language, "is", 2)) { /* Icelandic syntax */
 		return ast_say_number_full_is(chan, num, ints, language, options, audiofd, ctrlfd);
 	} else if (!strncasecmp(language, "it", 2)) { /* Italian syntax */
-	   return ast_say_number_full_it(chan, num, ints, language, audiofd, ctrlfd);
+		return ast_say_number_full_it(chan, num, ints, language, audiofd, ctrlfd);
 	} else if (!strncasecmp(language, "ka", 2)) { /* Georgian syntax */
-	   return ast_say_number_full_ka(chan, num, ints, language, options, audiofd, ctrlfd);
-	} else if (!strncasecmp(language, "mx", 2)) { /* deprecated Mexican syntax */
-		static int deprecation_warning = 0;
-		if (deprecation_warning++ % 10 == 0) {
-			ast_log(LOG_WARNING, "mx is not a standard language code.  Please switch to using es_MX instead.\n");
-		}
-		return ast_say_number_full_es(chan, num, ints, language, options, audiofd, ctrlfd);
+		return ast_say_number_full_ka(chan, num, ints, language, options, audiofd, ctrlfd);
 	} else if (!strncasecmp(language, "nl", 2)) { /* Dutch syntax */
-	   return ast_say_number_full_nl(chan, num, ints, language, audiofd, ctrlfd);
+		return ast_say_number_full_nl(chan, num, ints, language, audiofd, ctrlfd);
 	} else if (!strncasecmp(language, "no", 2)) { /* Norwegian syntax */
-	   return ast_say_number_full_no(chan, num, ints, language, options, audiofd, ctrlfd);
+		return ast_say_number_full_no(chan, num, ints, language, options, audiofd, ctrlfd);
 	} else if (!strncasecmp(language, "pl", 2)) { /* Polish syntax */
-	   return ast_say_number_full_pl(chan, num, ints, language, options, audiofd, ctrlfd);
+		return ast_say_number_full_pl(chan, num, ints, language, options, audiofd, ctrlfd);
 	} else if (!strncasecmp(language, "pt", 2)) { /* Portuguese syntax */
-	   return ast_say_number_full_pt(chan, num, ints, language, options, audiofd, ctrlfd);
+		return ast_say_number_full_pt(chan, num, ints, language, options, audiofd, ctrlfd);
 	} else if (!strncasecmp(language, "ru", 2)) { /* Russian syntax */
-	   return ast_say_number_full_ru(chan, num, ints, language, options, audiofd, ctrlfd);
+		return ast_say_number_full_ru(chan, num, ints, language, options, audiofd, ctrlfd);
 	} else if (!strncasecmp(language, "se", 2)) { /* Swedish syntax */
-	   return ast_say_number_full_se(chan, num, ints, language, options, audiofd, ctrlfd);
+		return ast_say_number_full_se(chan, num, ints, language, options, audiofd, ctrlfd);
 	} else if (!strncasecmp(language, "th", 2)) { /* Thai syntax */
 		return ast_say_number_full_th(chan, num, ints, language, audiofd, ctrlfd);
-	} else if (!strncasecmp(language, "tw", 2)) { /* deprecated Taiwanese syntax */
-		static int deprecation_warning = 0;
-		if (deprecation_warning++ % 10 == 0) {
-			ast_log(LOG_WARNING, "tw is a standard language code for Twi, not Taiwanese.  Please switch to using zh_TW instead.\n");
-		}
-		return ast_say_number_full_zh(chan, num, ints, language, audiofd, ctrlfd);
 	} else if (!strncasecmp(language, "zh", 2)) { /* Taiwanese / Chinese syntax */
-	   return ast_say_number_full_zh(chan, num, ints, language, audiofd, ctrlfd);
+		return ast_say_number_full_zh(chan, num, ints, language, audiofd, ctrlfd);
 	} else if (!strncasecmp(language, "ur", 2)) { /* Urdu syntax */
 		return ast_say_number_full_ur(chan, num, ints, language, options, audiofd, ctrlfd);
 	} else if (!strncasecmp(language, "vi", 2)) { /* Vietnamese syntax */
@@ -3645,12 +3621,6 @@
 		return ast_say_date_de(chan, t, ints, lang);
 	} else if (!strncasecmp(lang, "fr", 2)) { /* French syntax */
 		return ast_say_date_fr(chan, t, ints, lang);
-	} else if (!strncasecmp(lang, "ge", 2)) { /* deprecated Georgian syntax */
-		static int deprecation_warning = 0;
-		if (deprecation_warning++ % 10 == 0) {
-			ast_log(LOG_WARNING, "ge is not a standard language code.  Please switch to using ka instead.\n");
-		}
-		return ast_say_date_ka(chan, t, ints, lang);
 	} else if (!strncasecmp(lang, "gr", 2)) { /* Greek syntax */
 		return ast_say_date_gr(chan, t, ints, lang);
 	} else if (!strncasecmp(lang, "ja", 2)) { /* Japanese syntax */
@@ -4061,12 +4031,6 @@
 		return ast_say_date_with_format_ja(chan, t, ints, lang, format, tzone);
 	} else if (!strncasecmp(lang, "it", 2)) { /* Italian syntax */
 		return ast_say_date_with_format_it(chan, t, ints, lang, format, tzone);
-	} else if (!strncasecmp(lang, "mx", 2)) { /* deprecated Mexican syntax */
-		static int deprecation_warning = 0;
-		if (deprecation_warning++ % 10 == 0) {
-			ast_log(LOG_WARNING, "mx is not a standard language code.  Please switch to using es_MX instead.\n");
-		}
-		return ast_say_date_with_format_es(chan, t, ints, lang, format, tzone);
 	} else if (!strncasecmp(lang, "nl", 2)) { /* Dutch syntax */
 		return ast_say_date_with_format_nl(chan, t, ints, lang, format, tzone);
 	} else if (!strncasecmp(lang, "pl", 2)) { /* Polish syntax */
@@ -4075,12 +4039,6 @@
 		return ast_say_date_with_format_pt(chan, t, ints, lang, format, tzone);
 	} else if (!strncasecmp(lang, "th", 2)) { /* Thai syntax */
 		return ast_say_date_with_format_th(chan, t, ints, lang, format, tzone);
-	} else if (!strncasecmp(lang, "tw", 2)) { /* deprecated Taiwanese syntax */
-		static int deprecation_warning = 0;
-		if (deprecation_warning++ % 10 == 0) {
-			ast_log(LOG_WARNING, "tw is a standard language code for Twi, not Taiwanese.  Please switch to using zh_TW instead.\n");
-		}
-		return ast_say_date_with_format_zh(chan, t, ints, lang, format, tzone);
 	} else if (!strncasecmp(lang, "zh", 2)) { /* Taiwanese / Chinese syntax */
 		return ast_say_date_with_format_zh(chan, t, ints, lang, format, tzone);
 	} else if (!strncasecmp(lang, "vi", 2)) { /* Vietnamese syntax */
@@ -6897,12 +6855,6 @@
 		return ast_say_time_de(chan, t, ints, lang);
 	} else if (!strncasecmp(lang, "fr", 2)) { /* French syntax */
 		return ast_say_time_fr(chan, t, ints, lang);
-	} else if (!strncasecmp(lang, "ge", 2)) { /* deprecated Georgian syntax */
-		static int deprecation_warning = 0;
-		if (deprecation_warning++ % 10 == 0) {
-			ast_log(LOG_WARNING, "ge is not a standard language code.  Please switch to using ka instead.\n");
-		}
-		return ast_say_time_ka(chan, t, ints, lang);
 	} else if (!strncasecmp(lang, "gr", 2)) { /* Greek syntax */
 		return ast_say_time_gr(chan, t, ints, lang);
 	} else if (!strncasecmp(lang, "ja", 2)) { /* Japanese syntax */
@@ -6921,12 +6873,6 @@
 		return ast_say_time_pt(chan, t, ints, lang);
 	} else if (!strncasecmp(lang, "th", 2)) { /* Thai syntax */
 		return(ast_say_time_th(chan, t, ints, lang));
-	} else if (!strncasecmp(lang, "tw", 2)) { /* deprecated Taiwanese syntax */
-		static int deprecation_warning = 0;
-		if (deprecation_warning++ % 10 == 0) {
-			ast_log(LOG_WARNING, "tw is a standard language code for Twi, not Taiwanese.  Please switch to using zh_TW instead.\n");
-		}
-		return ast_say_time_zh(chan, t, ints, lang);
 	} else if (!strncasecmp(lang, "zh", 2)) { /* Taiwanese / Chinese syntax */
 		return ast_say_time_zh(chan, t, ints, lang);
 	}
@@ -7230,12 +7176,6 @@
 		return ast_say_datetime_de(chan, t, ints, lang);
 	} else if (!strncasecmp(lang, "fr", 2)) { /* French syntax */
 		return ast_say_datetime_fr(chan, t, ints, lang);
-	} else if (!strncasecmp(lang, "ge", 2)) { /* deprecated Georgian syntax */
-		static int deprecation_warning = 0;
-		if (deprecation_warning++ % 10 == 0) {
-			ast_log(LOG_WARNING, "ge is not a standard language code.  Please switch to using ka instead.\n");
-		}
-		return ast_say_datetime_ka(chan, t, ints, lang);
 	} else if (!strncasecmp(lang, "gr", 2)) { /* Greek syntax */
 		return ast_say_datetime_gr(chan, t, ints, lang);
 	} else if (!strncasecmp(lang, "ja", 2)) { /* Japanese syntax */
@@ -7254,12 +7194,6 @@
 		return ast_say_datetime_pt(chan, t, ints, lang);
 	} else if (!strncasecmp(lang, "th", 2)) { /* Thai syntax */
 		return ast_say_datetime_th(chan, t, ints, lang);
-	} else if (!strncasecmp(lang, "tw", 2)) { /* deprecated Taiwanese syntax */
-		static int deprecation_warning = 0;
-		if (deprecation_warning++ % 10 == 0) {
-			ast_log(LOG_WARNING, "tw is a standard language code for Twi, not Taiwanese.  Please switch to using zh_TW instead.\n");
-		}
-		return ast_say_datetime_zh(chan, t, ints, lang);
 	} else if (!strncasecmp(lang, "zh", 2)) { /* Taiwanese / Chinese syntax */
 		return ast_say_datetime_zh(chan, t, ints, lang);
 	}
@@ -7680,12 +7614,6 @@
 		return ast_say_datetime_from_now_en(chan, t, ints, lang);
 	} else if (!strncasecmp(lang, "fr", 2)) { /* French syntax */
 		return ast_say_datetime_from_now_fr(chan, t, ints, lang);
-	} else if (!strncasecmp(lang, "ge", 2)) { /* deprecated Georgian syntax */
-		static int deprecation_warning = 0;
-		if (deprecation_warning++ % 10 == 0) {
-			ast_log(LOG_WARNING, "ge is not a standard language code.  Please switch to using ka instead.\n");
-		}
-		return ast_say_datetime_from_now_ka(chan, t, ints, lang);
 	} else if (!strncasecmp(lang, "he", 2)) { /* Hebrew syntax */
 		return ast_say_datetime_from_now_he(chan, t, ints, lang);
 	} else if (!strncasecmp(lang, "ka", 2)) { /* Georgian syntax */

-- 
To view, visit https://gerrit.asterisk.org/10527
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I18e4d2af2e83556fa91e39a7338030583ef05d50
Gerrit-Change-Number: 10527
Gerrit-PatchSet: 1
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20181023/c0d39b59/attachment-0001.html>


More information about the asterisk-code-review mailing list