Apr
MAY
Jun
25
2024
2025
2026
About this capture
T h e W a y b a c k M a c h i n e - h t t p : / / w e b . a r c h i v e . o r g / w e b / 2 0 2 5 0 5 2 5 1 4 0 4 5 4 / h t t p s : / / g i t h u b . c o m / p y t h o n / p y t h o n - d o c s - p t - b r / p u l l / 1 3 8
S k i p t o c o n t e n t
N a v i g a t i o n M e n u
A p p e a r a n c e s e t t i n g s
●
G i t H u b C o p i l o t
W r i t e b e t t e r c o d e w i t h A I
G i t H u b M o d e l s
M a n a g e a n d c o m p a r e p r o m p t s
G i t H u b A d v a n c e d S e c u r i t y
F i n d a n d f i x v u l n e r a b i l i t i e s
A c t i o n s
A u t o m a t e a n y w o r k f l o w
C o d e s p a c e s
I n s t a n t d e v e n v i r o n m e n t s
I s s u e s
P l a n a n d t r a c k w o r k
C o d e R e v i e w
M a n a g e c o d e c h a n g e s
D i s c u s s i o n s
C o l l a b o r a t e o u t s i d e o f c o d e
C o d e S e a r c h
F i n d m o r e , s e a r c h l e s s
E x p l o r e
●
●
●
●
●
●
B y c o m p a n y s i z e
●
●
●
●
B y u s e c a s e
●
●
●
●
B y i n d u s t r y
●
●
●
●
●
V i e w a l l s o l u t i o n s
●
T o p i c s
●
●
●
●
●
E x p l o r e
●
●
●
●
●
●
●
G i t H u b S p o n s o r s
F u n d o p e n s o u r c e d e v e l o p e r s
T h e R e a d M E P r o j e c t
G i t H u b c o m m u n i t y a r t i c l e s
R e p o s i t o r i e s
●
●
●
●
E n t e r p r i s e p l a t f o r m
A I - p o w e r e d d e v e l o p e r p l a t f o r m
A v a i l a b l e a d d - o n s
G i t H u b A d v a n c e d S e c u r i t y
E n t e r p r i s e - g r a d e s e c u r i t y f e a t u r e s
C o p i l o t f o r b u s i n e s s
E n t e r p r i s e - g r a d e A I f e a t u r e s
P r e m i u m S u p p o r t
E n t e r p r i s e - g r a d e 2 4 / 7 s u p p o r t
●
S e a r c h o r j u m p t o . . .
Clear
S e a r c h s y n t a x t i p s
P r o v i d e f e e d b a c k
Include my email address so I can be contacted
C a n c e l
S u b m i t f e e d b a c k
S a v e d s e a r c h e s
U s e s a v e d s e a r c h e s t o f i l t e r y o u r r e s u l t s m o r e q u i c k l y
Query
To see all available qualifiers, see our documentation .
C a n c e l
C r e a t e s a v e d s e a r c h
A p p e a r a n c e s e t t i n g s
Y o u s i g n e d i n w i t h a n o t h e r t a b o r w i n d o w . R e l o a d t o r e f r e s h y o u r s e s s i o n .
Y o u s i g n e d o u t i n a n o t h e r t a b o r w i n d o w . R e l o a d t o r e f r e s h y o u r s e s s i o n .
Y o u s w i t c h e d a c c o u n t s o n a n o t h e r t a b o r w i n d o w . R e l o a d t o r e f r e s h y o u r s e s s i o n .
D i s m i s s a l e r t
{ { m e s s a g e } }
p y t h o n
/
p y t h o n - d o c s - p t - b r
P u b l i c
U h o h !
T h e r e w a s a n e r r o r w h i l e l o a d i n g . P l e a s e r e l o a d t h i s p a g e .
●
N o t i f i c a t i o n s
Y o u m u s t b e s i g n e d i n t o c h a n g e n o t i f i c a t i o n s e t t i n g s
●
F o r k
40
S t a r
1 4 2
●
C o d e
●
I s s u e s
9
●
P u l l r e q u e s t s
5
●
A c t i o n s
●
W i k i
●
S e c u r i t y
U h o h !
T h e r e w a s a n e r r o r w h i l e l o a d i n g . P l e a s e r e l o a d t h i s p a g e .
●
I n s i g h t s
A d d i t i o n a l n a v i g a t i o n o p t i o n s
●
C o d e
●
I s s u e s
●
P u l l r e q u e s t s
●
A c t i o n s
●
W i k i
●
S e c u r i t y
●
I n s i g h t s
N e w i s s u e
H a v e a q u e s t i o n a b o u t t h i s p r o j e c t ? S i g n u p f o r a f r e e G i t H u b a c c o u n t t o o p e n a n i s s u e a n d c o n t a c t i t s m a i n t a i n e r s a n d t h e c o m m u n i t y .
S i g n u p f o r G i t H u b
B y c l i c k i n g “ S i g n u p f o r G i t H u b ” , y o u a g r e e t o o u r t e r m s o f s e r v i c e a n d
p r i v a c y s t a t e m e n t . W e ’ l l o c c a s i o n a l l y s e n d y o u a c c o u n t r e l a t e d e m a i l s .
A l r e a d y o n G i t H u b ?
S i g n i n
t o y o u r a c c o u n t
J u m p t o b o t t o m
O p e n
g u i l h e r m e s r c
w a n t s t o m e r g e
8
c o m m i t s i n t o
p y t h o n : 3 . 1 2
C o u l d n o t l o a d b r a n c h e s
B r a n c h n o t f o u n d : { { r e f N a m e } }
L o a d i n g
C o u l d n o t l o a d t a g s
N o t h i n g t o s h o w
L o a d i n g
A r e y o u s u r e y o u w a n t t o c h a n g e t h e b a s e ?
S o m e c o m m i t s f r o m t h e o l d b a s e b r a n c h m a y b e r e m o v e d f r o m t h e t i m e l i n e ,
a n d o l d r e v i e w c o m m e n t s m a y b e c o m e o u t d a t e d .
L o a d i n g
C h a n g e b a s e
f r o m
g u i l h e r m e s r c : 3 . 1 2
O p e n
g u i l h e r m e s r c
w a n t s t o m e r g e
8
c o m m i t s i n t o
p y t h o n : 3 . 1 2
f r o m
g u i l h e r m e s r c : 3 . 1 2
C o n v e r s a t i o n
16
C o m m i t s
8
C h e c k s
0
F i l e s c h a n g e d
U h o h !
T h e r e w a s a n e r r o r w h i l e l o a d i n g . P l e a s e r e l o a d t h i s p a g e .
C o n v e r s a t i o n
T h i s f i l e c o n t a i n s h i d d e n o r b i d i r e c t i o n a l U n i c o d e t e x t t h a t m a y b e i n t e r p r e t e d o r c o m p i l e d d i f f e r e n t l y t h a n w h a t a p p e a r s b e l o w . T o r e v i e w , o p e n t h e f i l e i n a n e d i t o r t h a t r e v e a l s h i d d e n U n i c o d e c h a r a c t e r s .
L e a r n m o r e a b o u t b i d i r e c t i o n a l U n i c o d e c h a r a c t e r s
S h o w h i d d e n c h a r a c t e r s
N o d e s c r i p t i o n p r o v i d e d .
Sorry, something went wrong.
A d d f u n c t i o n t o c o m p a r e t r a n s l a t e d s t r i n g s b e t w e e n t w o c o m m i t s
2 4 0 f b 0 8
a d o r i l s o n
r e v i e w e d
N o v 1 1 , 2 0 2 3
V i e w r e v i e w e d c h a n g e s
. g i t h u b / s c r i p t s / g e t _ t r a n s l a t e d _ s t r i n g s _ b e t w e e n _ c o m m i t s . p y
O u t d a t e d
try:
commit_hash1_count = get_translated_commit_strings(commit_hash1)
commit_hash2_count = get_translated_commit_strings(commit_hash2)
return abs(commit_hash1_count - commit_hash2_count)
C o n t r i b u t o r
T h e r e w a s a p r o b l e m h i d i n g t h i s c o m m e n t .
C h o o s e a r e a s o n f o r h i d i n g t h i s c o m m e n t
T h e r e a s o n w i l l b e d i s p l a y e d t o d e s c r i b e t h i s c o m m e n t t o o t h e r s . L e a r n m o r e .
@ r f f o n t e n e l l e f a z s e n t i d o e s s e a b s a q u i ?
E s s e c o m m i t s t a n t o p o d e m s e r n o v a s s t r i n g s q u a n t o s t r i n g s t r a d u z i d a s , c e r t o ?
N e s t e c a s o , s a b e r o s i n a l e u a c h o v á l i d o .
Sorry, something went wrong.
A u t h o r
T h e r e w a s a p r o b l e m h i d i n g t h i s c o m m e n t .
C h o o s e a r e a s o n f o r h i d i n g t h i s c o m m e n t
T h e r e a s o n w i l l b e d i s p l a y e d t o d e s c r i b e t h i s c o m m e n t t o o t h e r s . L e a r n m o r e .
F a z s e n t i d o , m e e s q u e c i q u e p o d e r i a m c h e g a r n o v a s s t r i n g s
Sorry, something went wrong.
C o l l a b o r a t o r
T h e r e w a s a p r o b l e m h i d i n g t h i s c o m m e n t .
C h o o s e a r e a s o n f o r h i d i n g t h i s c o m m e n t
T h e r e a s o n w i l l b e d i s p l a y e d t o d e s c r i b e t h i s c o m m e n t t o o t h e r s . L e a r n m o r e .
N e s t e c a s o e s p e c í f i c o , a c r e d i t o q u e " s e n e g a t i v o , r e t o r n a 0 " s e r i a m a i s a d e q u a d o . S i g n i f i c a , p r o v a v e l m e n t e , q u e t e m o s n o v a s s t r i n g s n ã o t r a d u z i d a s
Sorry, something went wrong.
a d o r i l s o n
r e v i e w e d
N o v 1 1 , 2 0 2 3
V i e w r e v i e w e d c h a n g e s
. g i t h u b / s c r i p t s / g e t _ t r a n s l a t e d _ s t r i n g s _ b e t w e e n _ c o m m i t s . p y
O u t d a t e d
S h o w r e s o l v e d
H i d e r e s o l v e d
U h o h !
T h e r e w a s a n e r r o r w h i l e l o a d i n g . P l e a s e r e l o a d t h i s p a g e .
C o n t r i b u t o r
Este PR é pra resolver #135 , certo?
Sorry, something went wrong.
A u t h o r
Sorry, something went wrong.
C o l l a b o r a t o r
Ao invés de executar pocount para cada arquivo PO e ir adicionando as strings, que tal executar pocount em todos de uma só vez e pegar apenas o total?
$ pocount * .po ** /* .po
Processing file : about.po
Type Strings Words (source) Words (translation)
Translated: 10 (100%) 166 (100%) 170
Fuzzy: 0 ( 0%) 0 ( 0%) n/a
Untranslated: 0 ( 0%) 0 ( 0%) n/a
Total: 10 166 170
Unreviewed: 10 (100%) 166 (100%) 170
# ....
# pulei para o final
Processing file : whatsnew/index.po
Type Strings Words (source) Words (translation)
Translated: 3 (100%) 69 (100%) 78
Fuzzy: 0 ( 0%) 0 ( 0%) n/a
Untranslated: 0 ( 0%) 0 ( 0%) n/a
Total: 3 69 78
Unreviewed: 3 (100%) 69 (100%) 78
Processing file : TOTAL:
Type Strings Words (source) Words (translation)
Translated: 27887 ( 50%) 476230 ( 42%) 503086
Fuzzy: 0 ( 0%) 0 ( 0%) n/a
Untranslated: 27775 ( 49%) 653717 ( 57%) n/a
Total: 55662 1129947 503086
File count: 483
Pode-se corresponder ao texto "TOTAL:" como marcador de inicío para considerar a leitura de conteúdo e aí buscar correspondência do padrão pattern_translated_strings. Seria, assim, uma execução do pocount por commit.
Nota: git ls-files é uma alternativa para assegurar que apenas arquivos .po rastreados pelo repositório git sejam inclusivos. Mas talvez não seja necessário.
Sorry, something went wrong.
M e r g e b r a n c h ' p y t h o n : 3 . 1 2 ' i n t o 3 . 1 2
e 6 0 8 4 0 5
A u t h o r
Nessa ideia, como poderia ser pego o pocount total de um commit antigo? não consegui achar nada a respeito.
Sorry, something went wrong.
C o l l a b o r a t o r
Nessa ideia, como poderia ser pego o pocount total de um commit antigo? não consegui achar nada a respeito.
git switch com --detach. Por exemplo: git switch d16bd17181b2cc50d822eecbca9b13c51903dc7e --detach. Para voltar: git switch 3.12.
Para obter o branch atual, use git branch --show-current (me parece melhor que forçar via código um branch).
Outra opção é usar a biblioteca GitPython .
Sorry, something went wrong.
g u i l h e r m e s r c
a d d e d 5 c o m m i t s
N o v e m b e r 1 3 , 2 0 2 3 1 4 : 3 2
t e s t a n d o o u t r a f o r m a d e o b t e r a s s t r i n g s d o c o m m i t
c 1 a 0 1 3 5
r e t i r a n d o o c o n t e x t o
f 5 e 5 0 5 1
m u d a n d o a f o r m a c o m o é p e g o o c o m m i t s t r i n g s
b b c 6 0 1 5
r e f a t o r a n d o r u n _ o s _ c o m m a n d e g e t _ t r a n s l a t e d _ s t r i n g s _ b e t w e e n _ c o m m i t s . p y
a 7 7 d a 1 5
r e t i r a n d o d e p e n d e n c i a n ã o u s a d a
1 a d 8 8 7 c
A u t h o r
refatorei sobre aqueles aspectos do git switch, acredito que ainda falte o "se negativo, retorna 0"
Sorry, something went wrong.
C o n t r i b u t o r
refatorei sobre aqueles aspectos do git switch, acredito que ainda falte o "se negativo, retorna 0"
Isso faz mesmo sentido, @rffontenelle ? Pra mim, não faz. Qual é a informação que você tem que eu não tenho? :)
Sorry, something went wrong.
C o n t r i b u t o r
@guilhermesrc
E eu acho que tá dando uma exagerada no uso de try...except. Quais são as exceções possíveis?
Capturar Exception não é uma boa prática.
E depois retornar 0 pode dar algum tipo de confusão com "se negativo" ou "nada mudou mesmo".
Sorry, something went wrong.
C o l l a b o r a t o r
refatorei sobre aqueles aspectos do git switch, acredito que ainda falte o "se negativo, retorna 0"
Isso faz mesmo sentido, @rffontenelle ? Pra mim, não faz. Qual é a informação que você tem que eu não tenho? :)
Vamos para um exemplo.
Quinta-feira temos 20000 traduzidas. Sexta-feira as strings fontes foram atualizadas e alterações resultaram agora em termos 19900 porque pequenas alterações em strings existentes, "apagando" a tradução.
Neste caso, subtrair 19900 de 20000 (atual menos o anterior) vai dar 100 negativo. Aqui a diferença não é zero somente porque『perdemos tradução』(ainda aparecem como sugestões do Transifex). Neste caso, acho que podemos considerar zero tradução.
Sorry, something went wrong.
C o n t r i b u t o r
refatorei sobre aqueles aspectos do git switch, acredito que ainda falte o "se negativo, retorna 0"
Isso faz mesmo sentido, @rffontenelle ? Pra mim, não faz. Qual é a informação que você tem que eu não tenho? :)
Vamos para um exemplo.
Quinta-feira temos 20000 traduzidas. Sexta-feira as strings fontes foram atualizadas e alterações resultaram agora em termos 19900 porque pequenas alterações em strings existentes, "apagando" a tradução.
Neste caso, subtrair 19900 de 20000 (atual menos o anterior) vai dar 100 negativo. Aqui a diferença não é zero somente porque『perdemos tradução』(ainda aparecem como sugestões do Transifex). Neste caso, acho que podemos considerar zero tradução.
Então... isso não deveria ser -100?
Porque agora temos a certeza que há 100 novas strings pra traduzir, seja porque são realmente novas, seja porque algo que estava traduzido deixou de estar (o motivo me parece irrelevante). E aí sabemos que há trabalho de tradução pra ser feito. Se eu vejo 0, vou ignorar.
Isto é, tou pensando no caso de uso disso ser útil pra saber o que precisa ser traduzido. De repente, você tá pensando em outro caso de uso.
Vendo o título do PR e também a descricao em #135 parece que é isso mesmo... você focou no caso pontual de saber quanto traduzimos em uma sprint (e aí não faz sentido dizer "destraduzimos X strings") e eu pensei em comparar dois commits quaisquer...
Se possível, eu agora quero os dois. :D
Deixaria essas funções já feitas como estão, para esse cenários mais amplo que eu pensei, e escreveria nova(s ) para esse caso do "se negativo, retorna 0"
Sorry, something went wrong.
A u t h o r
@guilhermesrc
E eu acho que tá dando uma exagerada no uso de try...except. Quais são as exceções possíveis? Capturar Exception não é uma boa prática.
E depois retornar 0 pode dar algum tipo de confusão com "se negativo" ou "nada mudou mesmo".
Nossa realmente ficou bem genérico revisando, mais tarde reescrevo. Agora pensando, talvez no regex e ao manipular o OS ali seriam as exceções mais validas.
Sorry, something went wrong.
a l t e r a n d o b i b l i o t e c a d e m a n i p u l a ç ã o c o m o s i s t e m a e r e t i r a n d o t r y e x c …
…
9 6 4 d 5 8 7
…epts desnecessarios
A u t h o r
Tirei quase todos os exceptions, exceto a de manipulação do sistema, somente alterei a biblioteca.
Sorry, something went wrong.
S i g n u p f o r f r e e
t o j o i n t h i s c o n v e r s a t i o n o n G i t H u b .
A l r e a d y h a v e a n a c c o u n t ?
S i g n i n t o c o m m e n t
adorilson
adorilson left review comments
rffontenelle
rffontenelle left review comments
No one assigned
L a b e l s
N o n e y e t
No milestone
Successfully merging this pull request may close these issues.
3 p a r t i c i p a n t s
A d d t h i s s u g g e s t i o n t o a b a t c h t h a t c a n b e a p p l i e d a s a s i n g l e c o m m i t .
T h i s s u g g e s t i o n i s i n v a l i d b e c a u s e n o c h a n g e s w e r e m a d e t o t h e c o d e .
S u g g e s t i o n s c a n n o t b e a p p l i e d w h i l e t h e p u l l r e q u e s t i s c l o s e d .
S u g g e s t i o n s c a n n o t b e a p p l i e d w h i l e v i e w i n g a s u b s e t o f c h a n g e s .
O n l y o n e s u g g e s t i o n p e r l i n e c a n b e a p p l i e d i n a b a t c h .
A d d t h i s s u g g e s t i o n t o a b a t c h t h a t c a n b e a p p l i e d a s a s i n g l e c o m m i t .
A p p l y i n g s u g g e s t i o n s o n d e l e t e d l i n e s i s n o t s u p p o r t e d .
Y o u m u s t c h a n g e t h e e x i s t i n g c o d e i n t h i s l i n e i n o r d e r t o c r e a t e a v a l i d s u g g e s t i o n .
T h i s s u g g e s t i o n h a s b e e n a p p l i e d o r m a r k e d r e s o l v e d .
S u g g e s t i o n s c a n n o t b e a p p l i e d f r o m p e n d i n g r e v i e w s .
S u g g e s t i o n s c a n n o t b e a p p l i e d o n m u l t i - l i n e c o m m e n t s .
S u g g e s t i o n s c a n n o t b e a p p l i e d w h i l e t h e p u l l r e q u e s t i s q u e u e d t o m e r g e .
S u g g e s t i o n c a n n o t b e a p p l i e d r i g h t n o w . P l e a s e c h e c k b a c k l a t e r .
F o o t e r
© 2 0 2 5 G i t H u b , I n c .
●
T e r m s
●
P r i v a c y
●
S e c u r i t y
●
S t a t u s
●
D o c s
●
C o n t a c t
●
M a n a g e c o o k i e s
●
D o n o t s h a r e m y p e r s o n a l i n f o r m a t i o n
Y o u c a n ’ t p e r f o r m t h a t a c t i o n a t t h i s t i m e .