コード例 #1
0
ファイル: push.go プロジェクト: robmorgan/phraseapp-client
func (source *Source) uploadFile(localeFile *LocaleFile) error {
	uploadParams, err := source.setUploadParams(localeFile)
	if err != nil {
		return err
	}

	aUpload, err := phraseapp.UploadCreate(source.ProjectId, uploadParams)
	if err != nil {
		return err
	}

	printSummary(&aUpload.Summary)

	return nil
}
コード例 #2
0
func (source *Source) uploadFile(localeFile *LocaleFile) error {
	uploadParams, err := source.setUploadParams(localeFile)
	if err != nil {
		return err
	}

	if Debug {
		fmt.Println("Source file pattern:", source.File)
		fmt.Println("Actual File Location", uploadParams.File)
		if uploadParams.LocaleId != nil {
			fmt.Println("LocaleID/Name", *uploadParams.LocaleId)
		} else {
			fmt.Println("LocaleID/Name", nil)
		}

		if uploadParams.FileFormat != nil {
			fmt.Println("Format", *uploadParams.FileFormat)
		} else {
			fmt.Println("Format", nil)
		}
		fmt.Println("Tags", uploadParams.Tags)
		fmt.Println("Emoji", uploadParams.ConvertEmoji)
		if uploadParams.UpdateTranslations != nil {
			fmt.Println("UpdateTranslations", *uploadParams.UpdateTranslations)
		} else {
			fmt.Println("UpdateTranslations", nil)
		}
		fmt.Println("SkipUnverification", uploadParams.SkipUnverification)
		fmt.Println("FormatOpts", uploadParams.FormatOptions)
	}

	aUpload, err := phraseapp.UploadCreate(source.ProjectId, uploadParams)
	if err != nil {
		return err
	}

	printSummary(&aUpload.Summary)

	return nil
}