Skip to content

🌐 [Story localization] Removed sound text localizations after removal from system layer#37218

Merged
mszylkowski merged 1 commit intoampproject:mainfrom
mszylkowski:removeAudioLocales
Dec 14, 2021
Merged

🌐 [Story localization] Removed sound text localizations after removal from system layer#37218
mszylkowski merged 1 commit intoampproject:mainfrom
mszylkowski:removeAudioLocales

Conversation

@mszylkowski
Copy link
Copy Markdown
Contributor

@mszylkowski mszylkowski commented Dec 14, 2021

Closes #37164

We can safely remove the strings 31, 32, 33 (sound on, sound off, page has no sound) from all localization bundles since they aren't used in the new system UI.

Reduces mjs and js by 0.41kB and 0.47kB.

Used this script:

import json
import os
 
if __name__ == "__main__":
  fileNames = [x for x in os.listdir(".") if x[-5:] == ".json"]
  for name in fileNames:
    contents = dict()
    with open(name, "r", encoding="utf8") as f:
      contents = json.load(f)
      for num in [31, 32, 33]:
        del contents[str(num)]
    with open(name, "w", encoding="utf8") as f:
      json.dump(contents, f, indent=2, ensure_ascii=False)
      f.write("\n")
    print("Processed " + name)

@mszylkowski mszylkowski self-assigned this Dec 14, 2021
@amp-owners-bot
Copy link
Copy Markdown

Hey @gmajoulet, @newmuis! These files were changed:

extensions/amp-story/1.0/_locales/af.json
extensions/amp-story/1.0/_locales/am.json
extensions/amp-story/1.0/_locales/ar.json
extensions/amp-story/1.0/_locales/bg.json
extensions/amp-story/1.0/_locales/bn.json
extensions/amp-story/1.0/_locales/bs.json
extensions/amp-story/1.0/_locales/ca.json
extensions/amp-story/1.0/_locales/cs.json
extensions/amp-story/1.0/_locales/da.json
extensions/amp-story/1.0/_locales/de.json
extensions/amp-story/1.0/_locales/el.json
extensions/amp-story/1.0/_locales/en-GB.json
+59 more

@mszylkowski mszylkowski requested review from calebcordry and gmajoulet and removed request for calebcordry December 14, 2021 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Story system-layer] Remove localizations strings for audio messages

3 participants