Module: Theme::Messages

Defined in:
lib/project_types/theme/messages/messages.rb

Constant Summary collapse

MESSAGES =
{
  theme: {
    help: <<~HELP,
    ensure_user_error: "You are not authorized to edit themes on %s.",
    unauthorized_error: <<~EOD,
    ensure_user_try_this: <<~ENSURE_USER,
    stable_flag_suggestion: "If the current command isn't working as expected," \
      " we suggest re-running the command with the {{command: --stable}} flag",
    current_directory_is_not_theme_directory: "It doesn’t seem like you’re running this command" \
      " in a theme directory.",
    confirm_current_directory: "Are you sure you want to proceed?",
    init: {
      help: <<~HELP,
      ask_name: "Theme name",
    },
    publish: {
      confirmation: "This will change your live theme. Do you want to continue?",
      deploying: "Deploying theme",
      error: "Theme couldn't be deployed",
      help: <<~HELP,
      done: "Your theme is now live at %s",
      done_with_errors: "{{warning:Your theme was published with errors and is now live at %s.}}",
      not_found: "Theme #%s does not exist",
      no_themes_error: "You don't have any theme to be published.",
      no_themes_resolution: "Try to create an unpublished theme with {{command:theme push -u -t <theme_name>}}.",
      select: "Select theme to push to %s",
      confirm: "Are you sure you want to make %s the new live theme on %s?",
    },
    forms: {
      ask_password: "Password:",
      ask_store: "Store domain:",
      errors: "%s can't be blank",
    },
    push: {
      remove_abort: "Theme files weren't deleted",
      remove_confirm:
        "This will delete the local and remote copies of the theme files, which " \
        "can't be undone. Do you want to continue?",
      error: {
        push_error: "Theme files couldn't be pushed to Shopify",
        remove_error: "Theme files couldn't be removed from Shopify",
      },
      help: <<~HELP,
      info: {
        pushing: "Pushing theme files to %s (#%s) on %s",
      },
      push: "Pushing theme files to Shopify",
      select: "Select theme to push to %s",
      live: "Are you sure you want to push to your live theme?",
      theme: "\n  Theme: {{blue:%s #%s}} {{green:[live]}}",
      deprecated_themeid: <<~WARN,
      theme_not_found: "Theme \"%s\" doesn't exist",
      done: <<~DONE,
      done_with_errors: <<~WARN,
      name: "Theme name",
      with_errors: "Theme pushed with errors.",
    },
    serve: {
      theme_not_found: "Theme \"%s\" doesn't exist",
      help: <<~HELP,
      reload_mode_is_not_valid: "The live reload mode `%s` is not valid.",
      try_a_valid_reload_mode: "Try a valid live reload mode: %s.",
      viewing_theme: "Viewing theme…",
      syncing_theme: "Syncing theme #%s on %s",
      open_fail: "Couldn't open the theme",
      stop_signal: "Stop signal: \"%s\"",
      stopping: "Stopping…",
      auth: {
        error_message: <<~ERROR_MESSAGE,
        help_message: <<~HELP_MESSAGE,
      },
      operation: {
        status: {
          error: "ERROR",
          synced: "Synced",
          fixed: "Fixed",
        },
      },
      syncer: {
        forms: {
          apply_to_all: {
            title: "Would you like to apply this to all the other %s files?",
            yes: "Yes",
            no: "No",
          },
          update_strategy: {
            title_context: <<~TITLE,
            title_question: "What would you like to do?",
            keep_remote: "Keep the remote version",
            keep_local: "Keep the local version",
            union_merge: "Merge files (it may break the local file)",
            exit: "Exit",
          },
          update_remote_deleted_strategy: {
            title_context: <<~TITLE,
            title_question: "What would you like to do?",
            keep_remote: "Keep the remote version (and remove it locally)",
            keep_local: "Keep the local version (and restore it remotely)",
            union_merge: "Merge files (it may break the local file)",
            exit: "Exit",
          },
          delete_strategy: {
            title_context: <<~TITLE,
            title_question: "What would you like to do?",
            delete: "Delete permanently",
            restore: "Restore with the remote version",
            exit: "Exit",
          },
        },
        warnings: {
          unsupported_script: "unsupported script",
          unsupported_script_text: <<~UNSUPPORTED_SCRIPT,
          line_and_column: <<~LINE_AND_COLUMN,
        },
      },
      error: {
        invalid_subdirectory: <<~MESSAGE,
      },
      serving: <<~SERVING,
      download_changes: ", and use 'theme pull' to get the changes",
      customize_or_preview: <<~CUSTOMIZE_OR_PREVIEW,
      ensure_user: <<~ENSURE_USER,
      address_already_in_use: "The address \"%s\" is already in use.",
      try_port_option: "Use the --port=PORT option to serve the theme in a different port.",
      binding_error: "Couldn't bind to localhost." \
        " To serve your theme, set a different address with {{command:%s theme serve --host=<address>}}",
    },
    check: {
      help: <<~HELP,
      error: "Theme check failed with error:\n%s",
    },
    delete: {
      help: <<~HELP,
      select: "Select theme to delete from %s",
      done: "%s theme(s) deleted",
      no_themes_error: "You don't have any theme to be deleted.",
      no_themes_resolution: "Try to create an unpublished theme with {{command:theme push -u -t <theme_name>}}.",
      not_found: "{{x}} Theme #%s does not exist",
      live: "{{x}} Theme #%s is your live theme. You can't delete it.",
      confirm: "Are you sure you want to delete %s on %s?",
    },
    package: {
      help: <<~HELP,
      error: {
        prereq_command_required: "zip or 7zip is required for packaging a theme. Please install "\
          "zip or 7zip using the appropriate package manager for your system.",
        missing_config: "Provide a config/settings_schema.json to package your theme",
        missing_theme_name: "Provide a theme_info.theme_name configuration in config/settings_schema.json",
      },
      done: "Theme packaged in %s",
    },
    language_server: {
      help: <<~HELP,
    },
    pull: {
      help: <<~HELP,
      select: "Select a theme to pull from %s",
      pulling: "Pulling theme files from %s (#%s) on %s",
      done: "Theme pulled successfully.",
      done_with_errors: "{{warning:Your theme was pulled with errors.}}",
      deprecated_themeid: <<~WARN,
      theme_not_found: "Theme \"%s\" doesn't exist",
    },
    open: {
      select: "Select a theme to open in %s",
      theme_not_found: "Theme \"%s\" doesn't exist",
      details: <<~DETAILS,
      help: <<~HELP,
    },
    list: {
      title: "{{*}} List of {{bold:%s}} themes:",
      help: <<~HELP,
    },
    share: {
      help: <<~HELP,
      done: <<~DONE,
      upload: "Pushing theme files to %s (#%s) on %s",
    },
  },
}.freeze

Class Method Summary collapse

Class Method Details

.allObject



400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
# File 'lib/project_types/theme/messages/messages.rb', line 400

def self.all
  # In order to support theme development inside CLI3, we spawn CLI2 as a
  # subprocess. Whenever an error happens, we want to show the updated
  # version of the commands for the user to try.
  if ShopifyCLI::Environment.run_as_subprocess?
    ShopifyCLI::Utilities.deep_merge(MESSAGES, {
      theme: {
        serve: {
          auth: {
            error_message: <<~ERROR_MESSAGE,
            help_message: <<~HELP_MESSAGE,
              Run {{command:%s auth logout}} and {{command:%s theme dev --store STORE}} to authenticate again.
            HELP_MESSAGE
          },
          binding_error: "Couldn't bind to localhost." \
            " To serve your theme, set a different address with {{command:%s theme dev --host=<address>}}",
        },
      },
    })
  else
    MESSAGES
  end
end