- /**
- * Get a translated key if necessary.
- * @param array|null $mappings Array of mappings, 'original' => 'translated'
- * @param string $key
- * @return string
- */
- protected function getMappedKey( $mappings, $key ) {
- if ( !is_array( $mappings ) ) {
- return $key;
- }
-
- if ( !empty( $mappings[$key] ) ) {
- return $mappings[$key];
- }
-
- return $key;
- }
-