Status Update
Comments
ya...@gmail.com <ya...@gmail.com> #2
When i am trying to access Google Translate API using javascript when the query string size is around 13000 characters i am getting server response error code 400. Can you please let me know what is the request size limit if any exist.
st...@google.com <st...@google.com> #3
according to Google API FAQ
The maximum size of each text to be translated is 5000 characters, not including any HTML tags.
ya...@gmail.com <ya...@gmail.com> #4
st...@google.com <st...@google.com> #5
cy...@gmail.com <cy...@gmail.com> #6
[Deleted User] <[Deleted User]> #7
In some context:
<a id="text">bla bla...</a> -> <a id="text">alb</a>alb<a id="text">...</a>
after change anchor tag to 【】,it worked:
【bla bla ...】 -> 【alb alb ...】
np...@gmail.com <np...@gmail.com> #8
Input: <span id='1'>Per </span><span id='2'>Web-ERV</span><span id='3'>Handelsgericht Wien</span><span id='4'>Marxergasse 1a</span><span id='5'>1030 Wien</span><span id='6'>Firmenbuchsache</span>
Output: <span id='1'>Via</span> <span id='2'>web ERV</span> <span id='3'>Vienna Commercial Court</span> <span id='4'>Marxergasse 1a</span> <span id='5'>1030 <span id='6'>Wien</span></span> <span id='6'>Commercial thing</span>
Notice above in the output from the API, there is now an extra <span id="6"> now nested in <span id="5">, around partial content of <span id="5">.. This is completely unacceptable for a paid service, html translation is completely unusable with this bug.
sc...@gmail.com <sc...@gmail.com> #9
any update on this one?
[Deleted User] <[Deleted User]> #10
This issue is also affecting a user in case number 17353456.
Is there any update?
de...@aesop.com <de...@aesop.com> #11
lo...@google.com <lo...@google.com> #12
I kind of "solved" this by replacing my placeholders with some utf8 encoded string.
I was having trouble with strings like: "{s} Lorem Ipsum is simply dummy text of the printing and typesetting industry." but if I encode it like "{123_115_125} Lorem Ipsum is simply dummy text of the printing and typesetting industry." it seems to work fine.
Of course it's kind of cheating but it worked so far.
le...@google.com <le...@google.com> #13
<p class="tile-land-image">
<a href="../tutorials/1_overview.htm">
<img class="tile-image" src="../Resources/images/thumbnails/landing_environs.png"></a> </img>
</p>
co...@gmail.com <co...@gmail.com> #14
to...@jellyfish.com <to...@jellyfish.com> #16
Part of html Sent for translation:
<a class="d-flex align-items-center text-decoration-none" href="/customers">
<div class="ml-4">
<h6 class="font-weight-bold text-uppercase text-primary mb-0">Customer</h6>
</div>
</a>
Part of html received after translation:
<div class="ml-4">
<h6 class="font-weight-bold text-uppercase text-primary mb-0"> Client </h6>
</div>
This can be reproduced following the code from the Python guide[1]. The library version used is google-cloud-translate==2.0.0
[1]
ru...@gmail.com <ru...@gmail.com> #17
ku...@google.com <ku...@google.com>
ku...@google.com <ku...@google.com> #18
[Deleted User] <[Deleted User]> #19
dk...@west.com <dk...@west.com> #20
I experimented with Stackdriver and Python logger API. Here are my results.
Calls to
logger.info("info")
logger.warning("warning")
output results with the expected severity.
E.g.:
jsonPayload: {
message: "warning"
python_logger: "example"
}
receiveTimestamp: "2023-05-05T09:59:32.830676891Z"
severity: "WARNING"
A call to logger.log(300, 'notice')
produces an entry with severity "NOTICE".
The call logger.log(30, 'warning')
is equivalent to logger.warning("warning")
However, if you specify an arbitrary severity value, the log explorer is not happy
logger.log(25, 'between INFO and WARNING'); // It is not mapped to NOTICE
The above call works with no errors but the log explorer returns an error
Error: There is an unknown error while executing this operation.
va...@google.com <va...@google.com>
ku...@google.com <ku...@google.com>
di...@gmail.com <di...@gmail.com> #21
You may add custom log levels and extend Google Cloud Logging handler CloudLoggingHandler like so:
# A mapping of custom Python log levels to Google Cloud Logging severity
# 300 - GCLoud notice
# 700 - GCloud alert
# 800 - GCloud emergency
py_level_to_severity = {25:300, 70:700, 80:800}
class CloudLoggingHandlerX(CloudLoggingHandler):
def emit(self, record):
level = record.levelno
if record.levelno in py_level_to_severity:
record.levelno = py_level_to_severity[record.levelno]
super().emit(record)
record.levelno = level
Then, you will be able to log at notice, alert and emergency levels with Python Logger:
logger=logging.getLogger(__name__)
logger.log(25, "log entry with notice severity")
or you may even introduce new functions like notice, alert, emergency
logger.notice("log entry with notice severity")
Description
Documentation at [1] is not correct (no severity field is even populated):
- Logs to standard output have the INFO log level.
- Logs to standard error have the ERROR log level.
[1]