Class: Applocale::FilePathUtil

Inherits:
Object
  • Object
show all
Defined in:
lib/applocale/Util/file_util.rb

Constant Summary collapse

DIRNAME_MAIN =
'AppLocale'
DIRNAME_IOS =
'IOS'
DIRNAME_ANDROID =
'Android'
DIRNAME_JSON =
'locales'
FILENAME_CONFIG =
'AppLocaleFile'
FILENAME_XLSX =
'string.xlsx'
GOOGLE_CREDENTIALS =
'google_credentials.yaml'
EXPORT_FORMAT =
'xlsx'
RESOURCE_FOLDER =
'Resource'

Class Method Summary collapse

Class Method Details

.default_config_filenameObject



29
30
31
# File 'lib/applocale/Util/file_util.rb', line 29

def self.default_config_filename
  return FILENAME_CONFIG
end

.default_export_formatObject



62
63
64
# File 'lib/applocale/Util/file_util.rb', line 62

def self.default_export_format
  EXPORT_FORMAT
end

.default_export_toObject



33
34
35
# File 'lib/applocale/Util/file_util.rb', line 33

def self.default_export_to
  return RESOURCE_FOLDER
end

.default_google_credentials_filenameObject



25
26
27
# File 'lib/applocale/Util/file_util.rb', line 25

def self.default_google_credentials_filename
  return GOOGLE_CREDENTIALS
end

.default_localefile_relative_pathstr(platform, lang) ⇒ Object



42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/applocale/Util/file_util.rb', line 42

def self.default_localefile_relative_pathstr(platform, lang)
  if platform == Platform::IOS
    dirname = DIRNAME_IOS
  elsif platform == Platform::ANDROID
    dirname = DIRNAME_ANDROID
  elsif platform == Platform::JSON
    dirname = DIRNAME_JSON
  end
  unless dirname.nil?
    filename = Locale.filename(platform, lang)
    return "#{dirname}/#{filename}"
  end
  return nil
end

.default_mainfolderObject



37
38
39
# File 'lib/applocale/Util/file_util.rb', line 37

def self.default_mainfolder
  return DIRNAME_MAIN
end

.default_xlsx_relativepath_strObject



57
58
59
60
# File 'lib/applocale/Util/file_util.rb', line 57

def self.default_xlsx_relativepath_str
  filename = FILENAME_XLSX
  return filename
end

.get_proj_absoluat_path(proj_path) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/applocale/Util/file_util.rb', line 17

def self.get_proj_absoluat_path(proj_path)
  path = proj_path
  if !(Pathname.new proj_path).absolute?
    path = File.expand_path(proj_path,Dir.pwd)
  end
  return path
end