@@ 2357-2380 (lines=24) @@ | ||
2354 | private static $functionReplaceFromExcel = null; |
|
2355 | private static $functionReplaceToLocale = null; |
|
2356 | ||
2357 | public function _translateFormulaToLocale($formula) |
|
2358 | { |
|
2359 | if (self::$functionReplaceFromExcel === null) { |
|
2360 | self::$functionReplaceFromExcel = []; |
|
2361 | foreach (array_keys(self::$localeFunctions) as $excelFunctionName) { |
|
2362 | self::$functionReplaceFromExcel[] = '/(@?[^\w\.])' . preg_quote($excelFunctionName) . '([\s]*\()/Ui'; |
|
2363 | } |
|
2364 | foreach (array_keys(self::$localeBoolean) as $excelBoolean) { |
|
2365 | self::$functionReplaceFromExcel[] = '/(@?[^\w\.])' . preg_quote($excelBoolean) . '([^\w\.])/Ui'; |
|
2366 | } |
|
2367 | } |
|
2368 | ||
2369 | if (self::$functionReplaceToLocale === null) { |
|
2370 | self::$functionReplaceToLocale = []; |
|
2371 | foreach (array_values(self::$localeFunctions) as $localeFunctionName) { |
|
2372 | self::$functionReplaceToLocale[] = '$1' . trim($localeFunctionName) . '$2'; |
|
2373 | } |
|
2374 | foreach (array_values(self::$localeBoolean) as $localeBoolean) { |
|
2375 | self::$functionReplaceToLocale[] = '$1' . trim($localeBoolean) . '$2'; |
|
2376 | } |
|
2377 | } |
|
2378 | ||
2379 | return self::translateFormula(self::$functionReplaceFromExcel, self::$functionReplaceToLocale, $formula, ',', self::$localeArgumentSeparator); |
|
2380 | } |
|
2381 | ||
2382 | private static $functionReplaceFromLocale = null; |
|
2383 | private static $functionReplaceToExcel = null; |
|
@@ 2385-2408 (lines=24) @@ | ||
2382 | private static $functionReplaceFromLocale = null; |
|
2383 | private static $functionReplaceToExcel = null; |
|
2384 | ||
2385 | public function _translateFormulaToEnglish($formula) |
|
2386 | { |
|
2387 | if (self::$functionReplaceFromLocale === null) { |
|
2388 | self::$functionReplaceFromLocale = []; |
|
2389 | foreach (array_values(self::$localeFunctions) as $localeFunctionName) { |
|
2390 | self::$functionReplaceFromLocale[] = '/(@?[^\w\.])' . preg_quote($localeFunctionName) . '([\s]*\()/Ui'; |
|
2391 | } |
|
2392 | foreach (array_values(self::$localeBoolean) as $excelBoolean) { |
|
2393 | self::$functionReplaceFromLocale[] = '/(@?[^\w\.])' . preg_quote($excelBoolean) . '([^\w\.])/Ui'; |
|
2394 | } |
|
2395 | } |
|
2396 | ||
2397 | if (self::$functionReplaceToExcel === null) { |
|
2398 | self::$functionReplaceToExcel = []; |
|
2399 | foreach (array_keys(self::$localeFunctions) as $excelFunctionName) { |
|
2400 | self::$functionReplaceToExcel[] = '$1' . trim($excelFunctionName) . '$2'; |
|
2401 | } |
|
2402 | foreach (array_keys(self::$localeBoolean) as $excelBoolean) { |
|
2403 | self::$functionReplaceToExcel[] = '$1' . trim($excelBoolean) . '$2'; |
|
2404 | } |
|
2405 | } |
|
2406 | ||
2407 | return self::translateFormula(self::$functionReplaceFromLocale, self::$functionReplaceToExcel, $formula, self::$localeArgumentSeparator, ','); |
|
2408 | } |
|
2409 | ||
2410 | public static function localeFunc($function) |
|
2411 | { |