Class: Fastlane::Actions::OvoPoeditorStringsAction

Inherits:
Action
  • Object
show all
Defined in:
lib/fastlane/plugin/ovo_poeditor/actions/ovo_poeditor_strings_action.rb

Class Method Summary collapse

Class Method Details

.authorsObject



29
30
31
# File 'lib/fastlane/plugin/ovo_poeditor/actions/ovo_poeditor_strings_action.rb', line 29

def self.authors
  ["Alessio Arsuffi"]
end

.available_optionsObject



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/fastlane/plugin/ovo_poeditor/actions/ovo_poeditor_strings_action.rb', line 43

def self.available_options
  [
    FastlaneCore::ConfigItem.new(
      key: :api_token,
      env_name: "POEDITOR_API_TOKEN",
      description: "POEditor read-only API Token",
      optional: false,
      type: String
    ),
    FastlaneCore::ConfigItem.new(
      key: :project_id,
      env_name: "POEDITOR_PROJECT_ID",
      description: "POEditor Project ID",
      optional: false,
      type: String
    ),
    FastlaneCore::ConfigItem.new(
      key: :languages,
      env_name: "POEDITOR_LANGUAGES",
      description: "The languages to export strings for",
      optional: false,
      type: Array
    ),
    FastlaneCore::ConfigItem.new(
      key: :output_dir,
      env_name: "POEDITOR_OUTPUT_DIR",
      description: "Directory containing strings file",
      optional: false,
      type: String
    ),
    FastlaneCore::ConfigItem.new(
      key: :file_name,
      env_name: "POEDITOR_FILE_NAME",
      description: "The name of the file to be downloaded",
      optional: false,
      type: String
    ),
    FastlaneCore::ConfigItem.new(
      key: :file_format,
      env_name: "POEDITOR_EXPORT_FILE_FORMAT",
      description: "Export file format (xcstrings, apple_strings, android_strings)",
      optional: false,
      type: String
    )
  ]
end

.descriptionObject



25
26
27
# File 'lib/fastlane/plugin/ovo_poeditor/actions/ovo_poeditor_strings_action.rb', line 25

def self.description
  "Fetch latest POEditor terms and download them as .strings/.xml/.xcstrings file"
end

.detailsObject



38
39
40
41
# File 'lib/fastlane/plugin/ovo_poeditor/actions/ovo_poeditor_strings_action.rb', line 38

def self.details
  # Optional:
  "Fetch latest POEditor terms and download them as .strings/.xml/.xcstrings file"
end

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


90
91
92
# File 'lib/fastlane/plugin/ovo_poeditor/actions/ovo_poeditor_strings_action.rb', line 90

def self.is_supported?(platform)
  true
end

.return_valueObject



33
34
35
36
# File 'lib/fastlane/plugin/ovo_poeditor/actions/ovo_poeditor_strings_action.rb', line 33

def self.return_value
  # If your method provides a return value, you can describe here what it does
  "Return a file with all POEditor terms"
end

.run(params) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/fastlane/plugin/ovo_poeditor/actions/ovo_poeditor_strings_action.rb', line 7

def self.run(params)
  api_token = params[:api_token]
  project_id = params[:project_id]
  languages = params[:languages]
  output_dir = params[:output_dir]
  file_format = params[:file_format]
  file_name = params[:file_name]

  Helper::OvoPoeditorHelper.sync_strings(
    api_token: api_token,
    project_id: project_id,
    languages: languages,
    output_dir: output_dir,
    file_format: file_format,
    file_name: file_name
  )
end