Class: Fame::XliffExport

Inherits:
Object
  • Object
show all
Defined in:
lib/fame/xliff_export.rb

Overview

Handles import and export of .xliff files

Instance Method Summary collapse

Constructor Details

#initialize(xcode_proj_path) ⇒ XliffExport

Initializer

Parameters:

  • xcode_proj_path

    A path to a .xcodeproj file whose contents should be localized.



14
15
16
# File 'lib/fame/xliff_export.rb', line 14

def initialize(xcode_proj_path)
  @xcode_proj = XcodeProject.new(xcode_proj_path)
end

Instance Method Details

#export(path, ib_nodes) ⇒ Object

Exports all .xliff files for the current Xcode project

Parameters:

  • path

    A path to a folder where exported .xliff files should be placed.

  • ib_nodes

    An array of ‘LocalizedNode`s, generated from `InterfaceBuilder.nodes`.



23
24
25
26
27
28
29
30
# File 'lib/fame/xliff_export.rb', line 23

def export(path, ib_nodes)
  # export localizations
  export_xliffs(path)

  # update translation units based on the settings provided in Interface Builder
  # Localizations are only exported if explicitly enabled via the fame Interface Builder integration (see Fame.swift file).
  update_xliff_translation_units(path, ib_nodes)
end