Skip to content

Commit

Permalink
シングルクォーテーション忘れてた
Browse files Browse the repository at this point in the history
  • Loading branch information
Gorayan-sub committed Aug 17, 2021
1 parent a1f989e commit f865219
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import os
import re

from google.cloud import translate_v2 as translate
from ruamel import yaml
from ruamel.yaml.comments import CommentedMap, CommentedSeq
from ruamel.yaml.scalarstring import DoubleQuotedScalarString
from ruamel.yaml.scalarstring import DoubleQuotedScalarString, SingleQuotedScalarString
import sys


# Google Cloud Translation API で翻訳
def transtate(text):

if not isinstance(text, DoubleQuotedScalarString):
if (not isinstance(text, DoubleQuotedScalarString)) and (not isinstance(text, SingleQuotedScalarString)):
return text

result = client.translate(text, target_language='ja')
Expand Down

0 comments on commit f865219

Please sign in to comment.