Commit 27353217 authored by Zenovii Kholiavka's avatar Zenovii Kholiavka Committed by renatog
Browse files

Issue #2850367 by Zenovii_Kholyavka, Cyberwolf, mrinalini9, Andrii Kleba, Dave...

Issue #2850367 by Zenovii_Kholyavka, Cyberwolf, mrinalini9, Andrii Kleba, Dave Reid, RenatoG: Make change frequency options translatable
parent c187190f
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -55,18 +55,18 @@ class XmlSitemapUnitTest extends XmlSitemapTestBase {
    // The expected values.
    $expected = [
      FALSE,
      'always',
      'hourly',
      'daily',
      'weekly',
      'monthly',
      'yearly',
      'never',
      t('always', [], ['context' => 'Sitemap change frequency']),
      t('hourly', [], ['context' => 'Sitemap change frequency']),
      t('daily', [], ['context' => 'Sitemap change frequency']),
      t('weekly', [], ['context' => 'Sitemap change frequency']),
      t('monthly', [], ['context' => 'Sitemap change frequency']),
      t('yearly', [], ['context' => 'Sitemap change frequency']),
      t('never', [], ['context' => 'Sitemap change frequency']),
    ];

    foreach ($values as $i => $value) {
      $actual = xmlsitemap_get_changefreq($value);
      $this->assertSame($expected[$i], $actual);
      $this->assertEquals($expected[$i], $actual);
    }
  }

+6 −6
Original line number Diff line number Diff line
@@ -1360,12 +1360,12 @@ function xmlsitemap_link_bundle_settings_form_submit($form, &$form_state) {
 */
function xmlsitemap_get_changefreq_options() {
  return [
    XMLSITEMAP_FREQUENCY_ALWAYS => 'always',
    XMLSITEMAP_FREQUENCY_HOURLY => 'hourly',
    XMLSITEMAP_FREQUENCY_DAILY => 'daily',
    XMLSITEMAP_FREQUENCY_WEEKLY => 'weekly',
    XMLSITEMAP_FREQUENCY_MONTHLY => 'monthly',
    XMLSITEMAP_FREQUENCY_YEARLY => 'yearly',
    XMLSITEMAP_FREQUENCY_ALWAYS => t('always', [], ['context' => 'Sitemap change frequency']),
    XMLSITEMAP_FREQUENCY_HOURLY => t('hourly', [], ['context' => 'Sitemap change frequency']),
    XMLSITEMAP_FREQUENCY_DAILY => t('daily', [], ['context' => 'Sitemap change frequency']),
    XMLSITEMAP_FREQUENCY_WEEKLY => t('weekly', [], ['context' => 'Sitemap change frequency']),
    XMLSITEMAP_FREQUENCY_MONTHLY => t('monthly', [], ['context' => 'Sitemap change frequency']),
    XMLSITEMAP_FREQUENCY_YEARLY => t('yearly', [], ['context' => 'Sitemap change frequency']),
  ];
}