Abstract
This handles language selection to show formula messages on each language.
We are using an array to store the text messages in different languages, you can store this part in an include (see Using “includes” into your formula)

To test demo
We have done a dummy conditional just to see several messages, just enter “1”, “5” or “10” in the text box to see how messages are shown, then you can change the desired language of the store and repeat the test. (Language selector in the top of page)

Used functions
GetActiveLanguage

// Define language texts (could be in an include for all formulas)
// en-gb
$meLanguageTexts["en-gb"]["sample1"] = "Sample text 1";
$meLanguageTexts["en-gb"]["sample2"] = "Sample text 2";
$meLanguageTexts["en-gb"]["sample3"] = "Sample text 3";

// es-es
$meLanguageTexts["es-es"]["sample1"] = "Mensaje de ejemplo 1";
$meLanguageTexts["es-es"]["sample2"] = "Mensaje de ejemplo 2";
$meLanguageTexts["es-es"]["sample3"] = "Mensaje de ejemplo 3";


// Detect Language selected by customer
$meActiveLanguage = CFO_GetActiveLanguage();

// Dummy conditional only to show several text messages
// Using entered value in option_id number 20
if({20V}<5) {
   $meSelMsg = "sample1";
} elseif ({20V}<10) {
   $meSelMsg = "sample2";
} else {
   $meSelMsg = "sample3";
}

// Only to see selected type of message
CFO_InspectVariable($meSelMsg, "Selected type of message");

// Show a dummy message
$TheMessage = $meLanguageTexts[$meActiveLanguage][$meSelMsg];
CFO_AbortFormula($TheMessage );

// Debug
CFO_ShowDebug(true);

You can visit this demo in our Demo Store