|
@@ 121-126 (lines=6) @@
|
| 118 |
|
echo "Warning: not found locale {$set->slug} {$set->locale}, trying to match current sets..." . PHP_EOL; |
| 119 |
|
|
| 120 |
|
// source's 'ja' matches Jetpack's 'ja' |
| 121 |
|
if ( isset( $current_sets[$s] ) ) { |
| 122 |
|
echo "Found current set: $s\n"; |
| 123 |
|
$map[$set->locale] = $current_sets[$s]; |
| 124 |
|
unset( $current_sets[$s] ); |
| 125 |
|
continue; |
| 126 |
|
} |
| 127 |
|
|
| 128 |
|
// source's 'it' matches Jetpack's 'it_IT' |
| 129 |
|
foreach ( array_keys( $current_sets ) as $c ) { |
|
@@ 130-135 (lines=6) @@
|
| 127 |
|
|
| 128 |
|
// source's 'it' matches Jetpack's 'it_IT' |
| 129 |
|
foreach ( array_keys( $current_sets ) as $c ) { |
| 130 |
|
if ( 0 === strpos( $c, $s ) ) { |
| 131 |
|
echo "Found partial matched set: $s"; |
| 132 |
|
$map[$set->locale] = $current_sets[$c]; |
| 133 |
|
unset( $current_sets[$c] ); |
| 134 |
|
continue; |
| 135 |
|
} |
| 136 |
|
} |
| 137 |
|
|
| 138 |
|
echo "No entire or partial match, setting {$set->locale}{$suffix} as new locale." . PHP_EOL; |