PluginProbe
Image Optimizer – Compress Images and Convert to WebP or AVIF / 1.5.3
Image Optimizer – Compress Images and Convert to WebP or AVIF v1.5.3
1.7.7 1.7.6 1.7.5 1.7.4 trunk 1.0.0 1.0.1 1.0.2 1.1.0 1.2.0 1.2.1 1.3.0 1.4.0 1.4.1 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 All 33 releases
image-optimization / classes / locale.php

locale.php in Image Optimizer – Compress Images and Convert to WebP or AVIF 1.5.3, at classes/locale.php

28 lines 577 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace ImageOptimization\Classes;
4
5 if ( ! defined( 'ABSPATH' ) ) {
6 exit; // Exit if accessed directly.
7 }
8
9 class Locale {
10 private $original_locale;
11
12 public function set_utf_locale( int $category = LC_CTYPE ) {
13 setlocale( $category, 'en_US.UTF-8' );
14 }
15
16 public function get_locale( int $category = LC_CTYPE ) {
17 return setlocale( $category, 0 );
18 }
19
20 public function reset_to_original( int $category = LC_CTYPE ) {
21 return setlocale( $category, $this->original_locale );
22 }
23
24 public function __construct() {
25 $this->original_locale = $this->get_locale();
26 }
27 }
28